Page MenuHomeFreeBSD

malloc: do not count a MemGuard allocation in the type stats
Needs ReviewPublic

Authored by nick_spun.io on Sun, Oct 11, 11:29 PM.
Tags
None
Referenced Files
F175667944: D60629.diff
Mon, Oct 12, 9:38 AM
F175637160: D60629.id189536.diff
Mon, Oct 12, 5:15 AM
F175636868: D60629.diff
Mon, Oct 12, 5:12 AM
Subscribers

Details

Reviewers
adrian
Summary

uma_zalloc_arg() and uma_zalloc_domain() can return a MemGuard
allocation for a sampled zone. malloc() counted it with
malloc_type_zone_allocated(), but free() routes any MemGuard address to
memguard_free() through free_dbg() and never reaches
malloc_type_freed(), so the type's allocated total grew without a
matching free.

MemGuard allocations selected by malloc type already skip the accounting
on both sides. Skip it for a MemGuard address too, so the zone-selected
ones balance as well.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 78043
Build 74926: arc lint + arc unit