package memtrace

  1. Overview
  2. Docs

Use External to track non-GC-heap allocations in a Memtrace trace

type token
val alloc : bytes:int -> token option

alloc ~bytes reports an allocation of a given number of bytes.

If tracing is enabled, a small fraction of the calls to this function will return Some tok, where tok should be passed to free when the object is freed.

This function is very fast in the common case where it returns None

val free : token -> unit
OCaml

Innovation. Community. Security.