Remix.run Logo
▲ It's all about the allocator(aarol.dev)
36 points by ibobev 5 days ago | 6 comments
▲yeureka 2 hours ago | parent | next [-]

Bloomberg writes all of its C++ using an allocator aware version of the STL because of this issue. It’s open source and very high quality: https://github.com/bloomberg/bde

▲ibobev an hour ago | parent [-]

What do you mean by "allocator-aware version of the STL"? The standard STL is also allocator-aware, and its containers have versions with a template allocator parameter and a polymorphic allocator.

▲yeureka an hour ago | parent [-]

That is correct. However at Bloomberg all functions that potentially allocate memory have to have an allocator passed as an argument or use a local allocator since the BDE requires allocator parameters to always be passed, there are no default allocator arguments like in the STL.

▲alfiedotwtf 3 hours ago | parent | prev | next [-]

“It’s all about the Pentiums, baby”

▲ngriffiths 39 minutes ago | parent | prev | next [-]

> So, if you want to write truly memory-efficient code, just asking AI to do it for you might not be enough.

In hindsight, it would be pretty funny if "hey can you rewrite this game in Rust" is sufficient instructions to end up with memory-efficient code. In fact it would be pretty funny if it were enough to get this thing written in Rust, for all the specific details of what you actually mean when you say "this game"

▲fwlr 2 hours ago | parent | prev [-]

Oh, wow, this is a fantastic explanation for why “Zig makes you pass the allocator around as an argument to all your functions” is A Good Thing, Actually. Kudos to the author!