3 ms·
Maybe I'm mistaken, but it seems to me that the alignment between elements (at least in C++) is not being taken in account (or maybe I've misunderstood somethin
by malkia 11y ago
Maybe I'm mistaken, but it seems to me that the alignment between elements (at least in C++) is not being taken in account (or maybe I've misunderstood something).
- mccr8 11y agoThe size of each individual object is determined by calling malloc_usable_size on the block itself, so this includes any internal alignment, as well as any padding from the allocator after the object proper. So, you get the size of the object, using the callback. Then, if the object has fields that point to other objects, you call the reporter on those fields. Then those two quantities are totaled.
- malkia 11y agoAh, now I see, and it explains the two accumulators. Thanks!