diff --git a/garbage-collector.html b/garbage-collector.html index b10f298e6..6256dfd9d 100644 --- a/garbage-collector.html +++ b/garbage-collector.html @@ -242,13 +242,13 @@

The Mutable Write Barrier

> barrier_bench.exe [COLUMN ...] > >Columns that can be specified are: -> time - Number of nano secs taken. -> cycles - Number of CPU cycles (RDTSC) taken. -> alloc - Allocation of major, minor and promoted words. -> gc - Show major and minor collections per 1000 runs. -> percentage - Relative execution time as a percentage. -> speedup - Relative execution cost as a speedup. -> samples - Number of samples collected for profiling. +> time - Number of nano secs taken. +> cycles - Number of CPU cycles (RDTSC) taken. +> alloc - Allocation of major, minor and promoted words. +> gc - Show major and minor collections per 1000 runs. +> percentage - Relative execution time as a percentage. +> speedup - Relative execution cost as a speedup. +> samples - Number of samples collected for profiling. ... @@ -257,7 +257,7 @@

The Mutable Write Barrier

Attaching Finalizer Functions to Values

-

OCaml’s automatic memory management guarantees that a value will eventually be freed when it’s no longer in use, either via the GC sweeping it or the program terminating. It’s sometimes useful to run extra code just before a value is freed by the GC, for example, to check that a file descriptor has been closed, or that a log message is recorded.    

+

OCaml’s automatic memory management guarantees that a value will eventually be freed when it’s no longer in use, either via the GC sweeping it or the program terminating. It’s sometimes useful to run extra code just before a value is freed by the GC, for example, to check that a file descriptor has been closed, or that a log message is recorded.    

What Values Can Be Finalized?

Various values cannot have finalizers attached since they aren’t heap-allocated. Some examples of values that are not heap-allocated are integers, constant constructors, Booleans, the empty array, the empty list, and the unit value. The exact list of what is heap-allocated or not is implementation-dependent, which is why Core provides the Heap_block module to explicitly check before attaching the finalizer.