| > "You're imagining a world where everything is Node or Python or Java, or at the worst C on top of the well-defined standard library. And I'm telling you that the world is bigger than that." Why do you keep putting words in my mouth? > "But what if I don't have a heap? Not even a wrappable heap." I'm forced to repeat myself over again. At no point does my proposed API force you to rely on a heap. On the contrary, it lets you rely on whatever solution works best for you, in your specific case. In your custom kernel project, your custom allocator() can return a buffer from a memory pool you handle yourself. Your custom deallocator() will reclaim that memory back into your custom memory pool. In a different project, say a desktop app for Windows 10, the allocator() will simply call malloc(), and the deallocator() will call free(). This way, your allocator() can do whatever. Your deallocator() can do whatever. How is this restrictive in any way shape or form? |
I don't have either. I have a statically allocated buffer big enough for one frame of data, and I need to guarantee that it never gets used twice. My code does not have a custom allocator. It does not allocate.