[Git][cmucl/cmucl][master] 2 commits: adds additional keyword arguments to instance-usage for more fine-grained...

Raymond Toy gitlab at common-lisp.net
Fri Apr 9 21:00:07 UTC 2021



Raymond Toy pushed to branch master at cmucl / cmucl


Commits:
20de3e8e by Jon Boone at 2021-04-09T20:59:59+00:00
 adds additional keyword arguments to instance-usage for more fine-grained tracking of space allocation

- - - - -
68e97641 by Raymond Toy at 2021-04-09T21:00:00+00:00
Merge branch 'org.cmucl.debug.dynamic-space' into 'master'

adding additional keyword arguments to instance-usage ....

See merge request cmucl/cmucl!74
- - - - -


2 changed files:

- src/code/room.lisp
- src/i18n/locale/cmucl.pot


Changes:

=====================================
src/code/room.lisp
=====================================
@@ -707,11 +707,24 @@
 
 ;;; INSTANCE-USAGE  --  Public
 ;;;
-(defun instance-usage (space &key (top-n 15))
-  (declare (type spaces space) (type (or fixnum null) top-n))
-  "Print a breakdown by instance type of all the instances allocated in
-  Space.  If TOP-N is true, print only information for the the TOP-N types with
-  largest usage."
+(defun instance-usage (space &key 
+			       (top-n 15) 
+			       entries-var 
+			       (call-source "Unknown Caller"))
+  "Print a breakdown by instance type of all the allocation in Space.  
+
+  :TOP-N 
+      If true, print only the TOP-N types by largest usage.
+
+  :ENTRIES-VAR
+      If bound, contains the name of the symbol used to store the hash-table
+      of allocated entries for later processing.
+
+  :CALL-SOURCE
+      A string identifying the location from which instance-usage was called."
+
+  (declare (type spaces space) (type (or fixnum null) top-n)
+	   (type (or symbol null) entries-var) (type string call-source))
   (format t (intl:gettext "~2&~@[Top ~D ~]~(~A~) instance types:~%") top-n space)
   (let ((totals (make-hash-table :test #'eq))
 	(total-objects 0)
@@ -734,6 +747,10 @@
      space)
 
     (collect ((totals-list))
+      ;; set entries-var to the list of entries in totals
+      (when entries-var
+	(setf (symbol-value entries-var) (list call-source totals)))
+
       (maphash #'(lambda (class what)
 		   (totals-list (cons (prin1-to-string
 				       (class-proper-name class))


=====================================
src/i18n/locale/cmucl.pot
=====================================
@@ -6333,10 +6333,19 @@ msgstr ""
 
 #: src/code/room.lisp
 msgid ""
-"Print a breakdown by instance type of all the instances allocated in\n"
-"  Space.  If TOP-N is true, print only information for the the TOP-N types "
-"with\n"
-"  largest usage."
+"Print a breakdown by instance type of all the allocation in Space.  \n"
+"\n"
+"  :TOP-N \n"
+"      If true, print only the TOP-N types by largest usage.\n"
+"\n"
+"  :ENTRIES-VAR\n"
+"      If bound, contains the name of the symbol used to store the hash-table"
+"\n"
+"      of allocated entries for later processing.\n"
+"\n"
+"  :CALL-SOURCE\n"
+"      A string identifying the location from which instance-usage was "
+"called."
 msgstr ""
 
 #: src/code/room.lisp



View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/5c92c14c7a8497c7f6bf8670a8a9da2e77e66c3f...68e9764118c8f4b743d5b008f196049c7ab5390e

-- 
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/5c92c14c7a8497c7f6bf8670a8a9da2e77e66c3f...68e9764118c8f4b743d5b008f196049c7ab5390e
You're receiving this email because of your account on gitlab.common-lisp.net.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cmucl-cvs/attachments/20210409/7f3e465f/attachment-0001.html>


More information about the cmucl-cvs mailing list