Determing the Size of Allocated Memory Blocks

Q

How can you determine the size of an allocated portion of memory?

✍: FYIcenter

A

You can't, really. free() can , but there's no way for your program to know the trick free() uses. Even if you disassemble the library and discover the trick, thereís no guarantee the trick wonít change with the next release of the compiler.

2007-02-26, 5767👍, 0💬