# Memory representation guarantees and Obj.magic

**URL:** https://discuss.ocaml.org/t/memory-representation-guarantees-and-obj-magic/15494
**Category:** Learning
**Tags:** memory
**Created:** [October 23, 2024, 11:11pm UTC](https://discuss.ocaml.org/t/memory-representation-guarantees-and-obj-magic/15494 "2024-10-23T23:11:47Z")
**Posts on this page:** 1
**Showing post:** 9

<div class="post-metadata">

### Author: ![octachron](https://avatars.discourse-cdn.com/v4/letter/o/49beb7/32.png) [@octachron](https://discuss.ocaml.org/u/octachron)
#### Post date: [October 24, 2024, 1:53pm UTC](https://discuss.ocaml.org/t/memory-representation-guarantees-and-obj-magic/15494/9 "2024-10-24T13:53:39Z")

</div>

There are no `Obj.magic` function in the OCaml language.

The function is specific to the _OCaml compiler implementation_, and by using it you are stepping outside of any guarantees provided by the language. In theory, any new versions of the compiler may break any uses of `Obj.magic`. This does not happen that frequently, but this happens from time to time (the last time this has happened (due to a bug in a corner case of the type system) will be in one month for the 5.3 release).

---

_[View the full topic](https://discuss.ocaml.org/t/memory-representation-guarantees-and-obj-magic/15494)._
