Raymond Toy pushed to branch master at cmucl / cmucl
Commits:
-
20de3e8e
by Jon Boone at 2021-04-09T20:59:59+00:00
-
68e97641
by Raymond Toy at 2021-04-09T21:00:00+00:00
2 changed files:
Changes:
... | ... | @@ -707,11 +707,24 @@ |
707 | 707 |
|
708 | 708 |
;;; INSTANCE-USAGE -- Public
|
709 | 709 |
;;;
|
710 |
-(defun instance-usage (space &key (top-n 15))
|
|
711 |
- (declare (type spaces space) (type (or fixnum null) top-n))
|
|
712 |
- "Print a breakdown by instance type of all the instances allocated in
|
|
713 |
- Space. If TOP-N is true, print only information for the the TOP-N types with
|
|
714 |
- largest usage."
|
|
710 |
+(defun instance-usage (space &key
|
|
711 |
+ (top-n 15)
|
|
712 |
+ entries-var
|
|
713 |
+ (call-source "Unknown Caller"))
|
|
714 |
+ "Print a breakdown by instance type of all the allocation in Space.
|
|
715 |
+ |
|
716 |
+ :TOP-N
|
|
717 |
+ If true, print only the TOP-N types by largest usage.
|
|
718 |
+ |
|
719 |
+ :ENTRIES-VAR
|
|
720 |
+ If bound, contains the name of the symbol used to store the hash-table
|
|
721 |
+ of allocated entries for later processing.
|
|
722 |
+ |
|
723 |
+ :CALL-SOURCE
|
|
724 |
+ A string identifying the location from which instance-usage was called."
|
|
725 |
+ |
|
726 |
+ (declare (type spaces space) (type (or fixnum null) top-n)
|
|
727 |
+ (type (or symbol null) entries-var) (type string call-source))
|
|
715 | 728 |
(format t (intl:gettext "~2&~@[Top ~D ~]~(~A~) instance types:~%") top-n space)
|
716 | 729 |
(let ((totals (make-hash-table :test #'eq))
|
717 | 730 |
(total-objects 0)
|
... | ... | @@ -734,6 +747,10 @@ |
734 | 747 |
space)
|
735 | 748 |
|
736 | 749 |
(collect ((totals-list))
|
750 |
+ ;; set entries-var to the list of entries in totals
|
|
751 |
+ (when entries-var
|
|
752 |
+ (setf (symbol-value entries-var) (list call-source totals)))
|
|
753 |
+ |
|
737 | 754 |
(maphash #'(lambda (class what)
|
738 | 755 |
(totals-list (cons (prin1-to-string
|
739 | 756 |
(class-proper-name class))
|
... | ... | @@ -6333,10 +6333,19 @@ msgstr "" |
6333 | 6333 |
|
6334 | 6334 |
#: src/code/room.lisp
|
6335 | 6335 |
msgid ""
|
6336 |
-"Print a breakdown by instance type of all the instances allocated in\n"
|
|
6337 |
-" Space. If TOP-N is true, print only information for the the TOP-N types "
|
|
6338 |
-"with\n"
|
|
6339 |
-" largest usage."
|
|
6336 |
+"Print a breakdown by instance type of all the allocation in Space. \n"
|
|
6337 |
+"\n"
|
|
6338 |
+" :TOP-N \n"
|
|
6339 |
+" If true, print only the TOP-N types by largest usage.\n"
|
|
6340 |
+"\n"
|
|
6341 |
+" :ENTRIES-VAR\n"
|
|
6342 |
+" If bound, contains the name of the symbol used to store the hash-table"
|
|
6343 |
+"\n"
|
|
6344 |
+" of allocated entries for later processing.\n"
|
|
6345 |
+"\n"
|
|
6346 |
+" :CALL-SOURCE\n"
|
|
6347 |
+" A string identifying the location from which instance-usage was "
|
|
6348 |
+"called."
|
|
6340 | 6349 |
msgstr ""
|
6341 | 6350 |
|
6342 | 6351 |
#: src/code/room.lisp
|