]> git.kaiwu.me - haproxy.git/commit
MINOR: memprof: be careful to account allocations only once
authorWilly Tarreau <w@1wt.eu>
Mon, 8 Jun 2026 07:52:45 +0000 (09:52 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 8 Jun 2026 11:46:18 +0000 (13:46 +0200)
commit3fa818c78f28239eb0c309c684c52c22f9f0bb40
treeec663ce617c8ad207dc325ca2470912330254eb8
parenta7888f03731942205e3836bd1ecf6dec26cd9ed1
MINOR: memprof: be careful to account allocations only once

For certain calls like strdup(), certain libc call the malloc() symbol
themselves, resulting in both strdup() and malloc() accounting for the
allocation while a single free() call is accounted for. Usually it's
not very hard to spot as these allocations are done inside libc, but
yet they complicate the tracing of allocations.

Let's note when we enter a handler and refrain from doing the accounting
again in this case. This way, the strdup() call place will be accountable
for the allocation and the libc's internal malloc() will not be seen.
src/activity.c