Hacker News new | past | comments | ask | show | jobs | submit login

E.g. "Give me something in the ballpark of 4 KiB; more is OK, but tell me how much".

It would allow the allocator to return a chunk it has handy, instead of cutting it to size and fragmenting things, only to be asked to make the chunk larger a few microseconds later.

It will save both on housekeeping and fragmentation handling if the caller knows that the chunk will likely need to grow.




C++23 added `allocate_at_least`: https://en.cppreference.com/w/cpp/memory/allocator_traits/al...

I'm not sure if any standard libraries have an implementation that takes advantage of the "at least" yet.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: