<div dir="ltr">Dynamic languages commonly use an implementation technique where you take a pointer to an object (aligned on eight bytes so the lower three bits are zero), cast to intptr_t, change the lower three bits to a tag value indicating the type of the object, then later test the tag value, remove the tag, cast back to a pointer and dereference the pointer.<div><br></div><div>As I understand it, the standard says this is implementation defined. Does LLVM consider it to be defined behavior?</div><div><br></div><div>If so, is this still true if you write your own memory manager that allocates chunks of memory (rounded up to 8 bytes) from a big char array?</div><div><br></div><div>(Assuming a mainstream platform such as x64 - I'm not talking about a scenario where there is an unusual CPU architecture.)</div></div>