src/Pure/ML/ml_heap.ML
author desharna
Sun, 18 Dec 2022 14:03:43 +0100
changeset 76682 e260dabc88e6
parent 69826 1bea05713dde
child 77692 3e746e684f4b
permissions -rw-r--r--
added predicates asym_on and asymp_on and redefined asym and asymp to be abbreviations

(*  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;