3 ms·
A similar story about OCaml's garbage collector from https://twitter.com/mcclure111/status/637758978093547521 https://twitter.com/mcclure111/status/637758978093
by cpeterso 11y ago
A similar story about OCaml's garbage collector from https://twitter.com/mcclure111/status/637758978093547521 https://twitter.com/mcclure111/status/637758978093547521:
So the GC stats package in #OCaml has a record of how many words have been
allocated since startup and it's a float
it has been explained to me OCaml GC recording bytes in floats is because
float can store up to 2^52 integer but int only goes up to 2^30.
- danieldk 11y agoOCaml uses a tag bit to distinguish ints from pointers, so (unboxed) ints are only 31 bits: https://realworldocaml.org/v1/en/html/memory-representation-of-values.html https://realworldocaml.org/v1/en/html/memory-representation-... Floating point numbers are normally boxed (except for float arrays, float-only records, and some cases of local use).