How can one tell, given a void *
pointer, what is the size of a block allocated on this given address (previously allocated using malloc
; in Linux and Windows)? I hope both systems surely store this kind of information somewhere. That is, alternative of malloc_size
which exists on OSX/Darwin. Using gcc/mingw if it helps.
On Windows, things that use the MS CRT can use _msize, on Linux you could try malloc_usable_size...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With