Re:Undefined behavior in C is a reading error
by Joker_vD on Friday May 21, 2021 @07:00AM
(#27232522)
> and casting back is not guaranteed to do anything useful
I believe it's implementation-specific, precisely so that malloc/free can be implemented in conformant C.
The only tricky part is how you can "bless" parts of large memory block originally pointed to by void* (returned from mmap(), for example) to safely become ints and char[]s and structs...
I believe it's implementation-specific, precisely so that malloc/free can be implemented in conformant C.
The only tricky part is how you can "bless" parts of large memory block originally pointed to by void* (returned from mmap(), for example) to safely become ints and char[]s and structs...