src/Pure/ML/ml_heap.ML
author wenzelm
Tue, 07 Sep 2021 21:16:22 +0200
changeset 74261 d28a51dd9da6
parent 69826 1bea05713dde
child 77692 3e746e684f4b
permissions -rw-r--r--
export other entities, e.g. relevant for formal document output; clarified markup kind (PIDE) vs. export kind (e.g. MMT);

(*  Title:      Pure/ML/ml_heap.ML
    Author:     Makarius

ML heap operations.
*)

signature ML_HEAP =
sig
  val obj_size: 'a -> int
  val full_gc: unit -> unit
  val gc_now: unit -> Time.time
  val share_common_data: unit -> unit
  val save_child: string -> unit
end;

structure ML_Heap: ML_HEAP =
struct

val obj_size = PolyML.objSize;

val full_gc = PolyML.fullGC;

fun gc_now () = #timeGCReal (PolyML.Statistics.getLocalStats ());

fun share_common_data () = PolyML.shareCommonData PolyML.rootFunction;

fun save_child name =
  PolyML.SaveState.saveChild (name, List.length (PolyML.SaveState.showHierarchy ()));

end;