Github user jpeach commented on the pull request: https://github.com/apache/trafficserver/pull/489#issuecomment-186952049 Are you sure there isn't a better way to do this? - it is fairly ugly - it duplicates the allocation size tracking the allocator is already doing - it gets the alignment wrong in some cases (ie. you won't be 16 byte aligned any more). [glibc](http://man7.org/linux/man-pages/man3/malloc_usable_size.3.html) and [jemalloc](https://www.freebsd.org/cgi/man.cgi?query=malloc_usable_size) both provide ``malloc_usable_size``, which seems like it will tell you what you need to know here.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---