Summary: | Difference in allocation size for massif/tests/overloaded-new between clang++/libc++ and g++/libstdc++ | ||
---|---|---|---|
Product: | [Developer tools] valgrind | Reporter: | Paul Floyd <pjfloyd> |
Component: | massif | Assignee: | Nicholas Nethercote <njn> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | 3.22 GIT | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Paul Floyd
2023-11-04 08:03:49 UTC
So I think what happens is that arena_malloc allocates requested size + alignment + overhead Then the small block up to the alignment boundary gets freed. Since the alignment was added to the arena_malloc size then even in the worst case there will be the original user requested size available. That means that "extra-heap" is made up of overhead and slop from rounding up the the alignment boundary. And from what I see the slop depends on what was allocated previously. Since libc++ and libstdc++ do different allocations the slop is different. Conclusion: I need to filter the extra-heap for these aligned allocations. commit d248a4830770160cc7062f32ec91933804fe401a Author: Paul Floyd <pjfloyd@wanadoo.fr> Date: Sun Nov 5 13:35:01 2023 +0100 Bug 476535 - Difference in allocation size for massif/tests/overloaded-new between clang++/libc++ and g++/libstdc++ In the end all I could do was filter the results. libc++ and libstdc++ allocate different sizes of stuff for their own usr. That means that when we get to allocating aligned blocks there is some slop (up to the alignment size) that gets counted. And the amount of that slop depends on the prior (internal) allocations. |