2 ms·
I actually added this line: > Or more broadly, free() or realloc() and others already need to have some way to determine the size of the allocation based on th
by asveikau 10y ago
I actually added this line:
> Or more broadly, free() or realloc() and others already need to have some way to determine the size of the allocation based on the pointer
When I remembered I'd read a malloc implementation somewhere which actually didn't store the size in a header, but bakes in assumptions that you can determine the size of an allocation based on its address. So my naive thing isn't the only option, and I think if you have the kinds of concerns you raise there could be mitigations to be had.