X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fprofile.lisp;h=ddfd722b9630ccccc9a4ec1bca9f48f2ef09b5a7;hb=a160917364f85b38dc0826a5e3dcef87e3c4c62c;hp=5f5c2ffaaab9b2c89453582eb50dd334cd9f25a4;hpb=2e22486d5a66f899a2aeb08898b0cdd42dfc11f8;p=sbcl.git diff --git a/src/code/profile.lisp b/src/code/profile.lisp index 5f5c2ff..ddfd722 100644 --- a/src/code/profile.lisp +++ b/src/code/profile.lisp @@ -46,7 +46,8 @@ (make-hash-table ;; EQL testing isn't good enough for generalized function names ;; like (SETF FOO). - :test 'equal)) + :test 'equal + :synchronized t)) (defstruct (profile-info (:copier nil)) (name (missing-arg) :read-only t) (encapsulated-fun (missing-arg) :type function :read-only t) @@ -117,7 +118,7 @@ ;;; (VALUES ENCAPSULATION-FUN READ-STATS-FUN CLEAR-STATS-FUN). ;;; ;;; ENCAPSULATION-FUN is a plug-in replacement for ENCAPSULATED-FUN, -;;; which updates statistics whenver it's called. +;;; which updates statistics whenever it's called. ;;; ;;; READ-STATS-FUN returns the statistics: ;;; (VALUES COUNT TIME CONSING PROFILE). @@ -157,8 +158,8 @@ (let ((dticks 0) (dconsing 0) (inner-enclosed-profiles 0)) - (declare (type unsigned-byte dticks dconsing)) - (declare (type unsigned-byte inner-enclosed-profiles)) + (declare (type unsigned-byte dticks dconsing inner-enclosed-profiles) + (dynamic-extent dticks dconsing inner-enclosed-profiles)) (aver (typep dticks 'unsigned-byte)) (aver (typep dconsing 'unsigned-byte)) (aver (typep inner-enclosed-profiles 'unsigned-byte)) @@ -309,13 +310,14 @@ `(unprofile-all))) (defun unprofile-all () - (dohash (name profile-info *profiled-fun-name->info*) + (dohash ((name profile-info) *profiled-fun-name->info* + :locked t) (declare (ignore profile-info)) (unprofile-1-fun name))) (defun reset () "Reset the counters for all profiled functions." - (dohash (name profile-info *profiled-fun-name->info*) + (dohash ((name profile-info) *profiled-fun-name->info* :locked t) (declare (ignore name)) (funcall (profile-info-clear-stats-fun profile-info)))) @@ -358,7 +360,7 @@ Lisp process." (compute-overhead))) (let ((time-info-list ()) (no-call-name-list ())) - (dohash (name pinfo *profiled-fun-name->info*) + (dohash ((name pinfo) *profiled-fun-name->info* :locked t) (unless (eq (fdefinition name) (profile-info-encapsulation-fun pinfo)) (warn "Function ~S has been redefined, so times may be inaccurate.~@