5 ms·
Does OCaml even have a way of shedding memory safety?
by saagarjha 7y ago
Does OCaml even have a way of shedding memory safety?
- ncmncm 7y agoOCaml is an "obligate-GC" language. Most languages that offer optional GC, including Rust (with its RC and ARC boxing) and C++ (with std::shared_ptr), implement it mainly via reference-counting.
- tomp 7y agoYes, the `Unsafe` module (well, at least used to have it... fairly undocumented... maybe it's been removed?).
- tomp 7y agoOops, I misremembered the name. @pcwalton is right, it's called `Obj`.
- pcwalton 7y agoSure. Obj.magic is a bit cast.