X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fprofile.lisp;h=97dba1fca12154f662314a1689b06eb5b29715db;hb=558e7ce44e6a8305474dc55adbdbc1f7119c9a5e;hp=729be4f4e06e634c04317ec78e19c1e7281531ad;hpb=716c33a5b0ee4c745b48c2bf7635e83815b168f9;p=sbcl.git diff --git a/src/code/profile.lisp b/src/code/profile.lisp index 729be4f..97dba1f 100644 --- a/src/code/profile.lisp +++ b/src/code/profile.lisp @@ -162,6 +162,7 @@ (let ((dticks 0) (dconsing 0) (inner-enclosed-profiles 0)) + (declare (optimize (safety 0))) (declare (type unsigned-byte dticks dconsing)) (declare (type unsigned-byte inner-enclosed-profiles)) (aver (typep dticks 'unsigned-byte)) @@ -194,9 +195,13 @@ (pcounter-or-fixnum->integer *enclosed-profiles*)) (let ((net-dticks (fastbig- dticks *enclosed-ticks*))) (fastbig-incf-pcounter-or-fixnum ticks net-dticks)) - (let ((net-dconsing (fastbig- dconsing - (pcounter-or-fixnum->integer - *enclosed-consing*)))) + (let ((net-dconsing (fastbig- + (fastbig- dconsing + (pcounter-or-fixnum->integer + *enclosed-consing*)) + ;; three variables with value + ;; cells two bytes each. + (* 3 2 sb-vm:n-word-bytes)))) (fastbig-incf-pcounter-or-fixnum consing net-dconsing)) (fastbig-incf-pcounter-or-fixnum profiles inner-enclosed-profiles)))) @@ -248,8 +253,9 @@ (let ((encapsulated-fun (fdefinition name))) (multiple-value-bind (encapsulation-fun read-stats-fun clear-stats-fun) (profile-encapsulation-lambdas encapsulated-fun) - (setf (fdefinition name) - encapsulation-fun) + (without-package-locks + (setf (fdefinition name) + encapsulation-fun)) (setf (gethash name *profiled-fun-name->info*) (make-profile-info :name name :encapsulated-fun encapsulated-fun @@ -275,7 +281,8 @@ (cond (pinfo (remhash name *profiled-fun-name->info*) (if (eq (fdefinition name) (profile-info-encapsulation-fun pinfo)) - (setf (fdefinition name) (profile-info-encapsulated-fun pinfo)) + (without-package-locks + (setf (fdefinition name) (profile-info-encapsulated-fun pinfo))) (warn "preserving current definition of redefined function ~S" name))) (t @@ -514,6 +521,6 @@ Lisp process." ;;; then load the old *OVERHEAD* value from the .core file into a ;;; different machine running at a different speed. We avoid this by ;;; erasing *CALL-OVERHEAD* whenever we save a .core file. -(pushnew (lambda () - (makunbound '*overhead*)) - *before-save-initializations*) +(defun profile-deinit () + (without-package-locks + (makunbound '*overhead*)))