From f8cb958b9afbd7633c3e2f21a3711fd240e428b1 Mon Sep 17 00:00:00 2001 From: Juho Snellman Date: Mon, 19 Nov 2007 01:04:38 +0000 Subject: [PATCH] 1.0.11.31: Make SB-PROFILE cons less * dx allocate the closed over variables for the profiling wrapper * Fixes a bug where a profiled function A calling profiled function B would cause 6 words of consing to be attributed to A in the profiler. --- NEWS | 4 +++- src/code/profile.lisp | 6 +++--- version.lisp-expr | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index 22b35fa..f90ba4e 100644 --- a/NEWS +++ b/NEWS @@ -6,7 +6,9 @@ changes in sbcl-1.0.12 relative to sbcl-1.0.11: SB-EXT:WITH-LOCKED-HASH-TABLE, and SB-EXT:HASH-TABLE-SYNCHRONIZED-P. * optimization: CONCATENATE on strings is an order of magnitue faster - in code compiled with (> SPEED SPACE) + in code compiled with (> SPEED SPACE). + * bug fix: SB-PROFILE will no longer report extra consing for nested + calls to profiled functions. * bug fix: if file compilation is aborted, the partial fasl is now deleted, and COMPILE-FILE returns NIL as the primary value. * bug fix: number of thread safety issues relating to SBCL's internal diff --git a/src/code/profile.lisp b/src/code/profile.lisp index 15b8c74..b6b2a21 100644 --- a/src/code/profile.lisp +++ b/src/code/profile.lisp @@ -145,7 +145,7 @@ (values ;; ENCAPSULATION-FUN (lambda (&more arg-context arg-count) - (declare (optimize speed safety)) + (declare (optimize speed safety sb-c::stack-allocate-dynamic-extent)) ;; Make sure that we're not recursing infinitely. (when (boundp '*computing-profiling-data-for*) (unprofile-all) ; to avoid further recursion @@ -158,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)) diff --git a/version.lisp-expr b/version.lisp-expr index 81e0aa8..15d0f74 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"1.0.11.30" +"1.0.11.31" -- 1.7.10.4