more operations for profiling;
authorwenzelm
Thu, 30 Mar 2023 16:09:19 +0200
changeset 77765 8db468bd1ec6
parent 77764 44a6ac96314d
child 77766 c6c4069a86f3
more operations for profiling;
src/Pure/ML/ml_heap.ML
--- a/src/Pure/ML/ml_heap.ML	Thu Mar 30 16:04:02 2023 +0200
+++ b/src/Pure/ML/ml_heap.ML	Thu Mar 30 16:09:19 2023 +0200
@@ -8,6 +8,7 @@
 sig
   val obj_size: 'a -> int
   val sizeof1: 'a -> int
+  val sizeof_list: 'a list -> int
   val sizeof: 'a list -> int
   val full_gc: unit -> unit
   val gc_now: unit -> Time.time
@@ -21,7 +22,9 @@
 val obj_size = PolyML.objSize;
 
 fun sizeof1 x = obj_size x * ML_System.platform_obj_size;
-fun sizeof xs = (obj_size xs - 3 * length xs) * ML_System.platform_obj_size;
+
+fun sizeof_list xs = 3 * length xs * ML_System.platform_obj_size;
+fun sizeof xs = obj_size xs * ML_System.platform_obj_size - sizeof_list xs;
 
 val full_gc = PolyML.fullGC;