3 ms·
I'm not talking about any OS concept, but about the concept of how memory works in the virtual machine defined by the C standard. That implementation isn't comp
by astrange 6y ago
I'm not talking about any OS concept, but about the concept of how memory works in the virtual machine defined by the C standard. That implementation isn't compliant just because it works; if an undefined behavior checker could see into the malloc implementation, it would see that it's returning pointers inside the same object, which conflicts with the (impossible to implement) rule that malloc returns pointers to different objects.
The practical consequence of this is malloc is kept in a different library and not inlined into callers, and asan doesn't work with custom allocators unless you tell it they behave like malloc.