Github user PSUdaemon commented on a diff in the pull request: https://github.com/apache/trafficserver/pull/489#discussion_r53529845 --- Diff: lib/ts/ink_memory.cc --- @@ -209,6 +210,46 @@ ats_mlock(caddr_t addr, size_t len) return res; } +void * +ats_track_malloc(size_t size, uint64_t *stat) +{ + // pad with 8 bytes to add allocation size + void *ptr = malloc(size + 8); + memcpy(ptr, &size, 8); + ink_atomic_increment(stat, size); + return (void *)((uint64_t)ptr + 8); +} --- End diff -- I know we only support 64 bit, but shouldn't we still use `sizeof()` and `uintptr_t`?
--- 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. ---