package spotlib

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file xgc.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
open Gc

let used_words () =
  let c = get () in
  set { c with minor_heap_size = 1000; (* 1k words = 8k bytes *) };
  compact ();
  let s = stat () in
  let res = s.live_words in
  set c;
  res

let with_compacts f v =
  let used_before = used_words () in
  Exn.protect_with f v
    ~finally:(fun _ ->
      let used_after = used_words () in
      used_before, used_after)
OCaml

Innovation. Community. Security.