Ignore:
Timestamp:
Mar 18, 2010, 1:36:57 PM (9 years ago)
Author:
gz
Message:

From trunk: heap-ivector-utilization (r13533)

Location:
branches/working-0711/ccl
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0711/ccl

  • branches/working-0711/ccl/lib/misc.lisp

    r13510 r13547  
    10431043      data)))
    10441044
     1045(defun collect-heap-ivector-utilization-by-typecode ()
     1046  (let* ((counts (make-array 256 :initial-element 0))
     1047         (sizes (make-array 256 :initial-element 0))
     1048         (physical-sizes (make-array 256 :initial-element 0))
     1049         (array-size-function (arch::target-array-data-size-function
     1050                               (backend-target-arch *host-backend*)))
     1051         (result ()))
     1052    (declare (dynamic-extent counts sizes))
     1053    (with-lock-grabbed (*heap-ivector-lock*)
     1054      (dolist (vector *heap-ivectors*)
     1055        (let* ((typecode (typecode vector))
     1056               (logsize (funcall array-size-function typecode (uvsize vector)))
     1057               (physsize (+ logsize
     1058                            ;; header, delta, round up
     1059                            #+32-bit-target (+ 4 2 7)
     1060                            #+64-bit-target (+ 8 2 15))))
     1061          (incf (aref counts typecode))
     1062          (incf (aref sizes typecode) logsize)
     1063          (incf (aref physical-sizes typecode) physsize))))
     1064    (dotimes (i 256 result)
     1065      (when (plusp (aref counts i))
     1066        (push (list (aref *heap-utilization-vector-type-names* i)
     1067                    (aref counts i)
     1068                    (aref sizes i)
     1069                    (aref physical-sizes i))
     1070              result)))))
     1071
     1072(defun heap-ivector-utilization (&key (stream *debug-io*)
     1073                                      (unit nil)
     1074                                      (sort :size))
     1075  (let* ((data (collect-heap-ivector-utilization-by-typecode)))
     1076    (report-heap-utilization data :stream stream :unit unit :sort sort)))
     1077 
    10451078(defvar *heap-utilization-vector-type-names*
    10461079  (let* ((a (make-array 256)))
Note: See TracChangeset for help on using the changeset viewer.