Hacker News new | ask | show | jobs
by khuey 771 days ago
Things like malloc_usable_size() exist but you're not supposed to use the overage it tells you about so they're not very useful APIs.
1 comments

This can be instrumented by the compiler or more likely runtime to detect buffer overruns. Imperfectly of course if you share the page(s) with other allocations but it's worth considering.