Skip to content
Snippets Groups Projects
Commit 68e97641 authored by Raymond Toy's avatar Raymond Toy
Browse files

Merge branch 'org.cmucl.debug.dynamic-space' into 'master'

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

See merge request cmucl/cmucl!74
parents 5c92c14c 20de3e8e
No related branches found
No related tags found
No related merge requests found
...@@ -707,11 +707,24 @@ ...@@ -707,11 +707,24 @@
;;; INSTANCE-USAGE -- Public ;;; INSTANCE-USAGE -- Public
;;; ;;;
(defun instance-usage (space &key (top-n 15)) (defun instance-usage (space &key
(declare (type spaces space) (type (or fixnum null) top-n)) (top-n 15)
"Print a breakdown by instance type of all the instances allocated in entries-var
Space. If TOP-N is true, print only information for the the TOP-N types with (call-source "Unknown Caller"))
largest usage." "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) (format t (intl:gettext "~2&~@[Top ~D ~]~(~A~) instance types:~%") top-n space)
(let ((totals (make-hash-table :test #'eq)) (let ((totals (make-hash-table :test #'eq))
(total-objects 0) (total-objects 0)
...@@ -734,6 +747,10 @@ ...@@ -734,6 +747,10 @@
space) space)
(collect ((totals-list)) (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) (maphash #'(lambda (class what)
(totals-list (cons (prin1-to-string (totals-list (cons (prin1-to-string
(class-proper-name class)) (class-proper-name class))
......
...@@ -6333,10 +6333,19 @@ msgstr "" ...@@ -6333,10 +6333,19 @@ msgstr ""
   
#: src/code/room.lisp #: src/code/room.lisp
msgid "" msgid ""
"Print a breakdown by instance type of all the instances allocated in\n" "Print a breakdown by instance type of all the allocation in Space. \n"
" Space. If TOP-N is true, print only information for the the TOP-N types " "\n"
"with\n" " :TOP-N \n"
" largest usage." " 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 "" msgstr ""
   
#: src/code/room.lisp #: src/code/room.lisp
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment