| author | wenzelm | 
| Mon, 13 Feb 2023 10:49:33 +0100 | |
| changeset 77287 | d060545f01a2 | 
| parent 69826 | 1bea05713dde | 
| child 77692 | 3e746e684f4b | 
| permissions | -rw-r--r-- | 
| 62508 
d0b68218ea55
discontinued RAW session: bootstrap directly from isabelle_process RAW_ML_SYSTEM;
 wenzelm parents: 
62468diff
changeset | 1 | (* Title: Pure/ML/ml_heap.ML | 
| 62467 | 2 | Author: Makarius | 
| 3 | ||
| 4 | ML heap operations. | |
| 5 | *) | |
| 6 | ||
| 7 | signature ML_HEAP = | |
| 8 | sig | |
| 62825 
e6e80a8bf624
structure PolyML is sealed after bootstrap: all ML system access is managed by Isabelle;
 wenzelm parents: 
62630diff
changeset | 9 | val obj_size: 'a -> int | 
| 67622 | 10 | val full_gc: unit -> unit | 
| 69826 
1bea05713dde
physical vs. logical events, the latter takes GC time into account;
 wenzelm parents: 
67622diff
changeset | 11 | val gc_now: unit -> Time.time | 
| 62467 | 12 | val share_common_data: unit -> unit | 
| 62825 
e6e80a8bf624
structure PolyML is sealed after bootstrap: all ML system access is managed by Isabelle;
 wenzelm parents: 
62630diff
changeset | 13 | val save_child: string -> unit | 
| 62467 | 14 | end; | 
| 15 | ||
| 16 | structure ML_Heap: ML_HEAP = | |
| 17 | struct | |
| 62825 
e6e80a8bf624
structure PolyML is sealed after bootstrap: all ML system access is managed by Isabelle;
 wenzelm parents: 
62630diff
changeset | 18 | |
| 
e6e80a8bf624
structure PolyML is sealed after bootstrap: all ML system access is managed by Isabelle;
 wenzelm parents: 
62630diff
changeset | 19 | val obj_size = PolyML.objSize; | 
| 
e6e80a8bf624
structure PolyML is sealed after bootstrap: all ML system access is managed by Isabelle;
 wenzelm parents: 
62630diff
changeset | 20 | |
| 67622 | 21 | val full_gc = PolyML.fullGC; | 
| 22 | ||
| 69826 
1bea05713dde
physical vs. logical events, the latter takes GC time into account;
 wenzelm parents: 
67622diff
changeset | 23 | fun gc_now () = #timeGCReal (PolyML.Statistics.getLocalStats ()); | 
| 
1bea05713dde
physical vs. logical events, the latter takes GC time into account;
 wenzelm parents: 
67622diff
changeset | 24 | |
| 62825 
e6e80a8bf624
structure PolyML is sealed after bootstrap: all ML system access is managed by Isabelle;
 wenzelm parents: 
62630diff
changeset | 25 | fun share_common_data () = PolyML.shareCommonData PolyML.rootFunction; | 
| 
e6e80a8bf624
structure PolyML is sealed after bootstrap: all ML system access is managed by Isabelle;
 wenzelm parents: 
62630diff
changeset | 26 | |
| 
e6e80a8bf624
structure PolyML is sealed after bootstrap: all ML system access is managed by Isabelle;
 wenzelm parents: 
62630diff
changeset | 27 | fun save_child name = | 
| 
e6e80a8bf624
structure PolyML is sealed after bootstrap: all ML system access is managed by Isabelle;
 wenzelm parents: 
62630diff
changeset | 28 | PolyML.SaveState.saveChild (name, List.length (PolyML.SaveState.showHierarchy ())); | 
| 
e6e80a8bf624
structure PolyML is sealed after bootstrap: all ML system access is managed by Isabelle;
 wenzelm parents: 
62630diff
changeset | 29 | |
| 62467 | 30 | end; |