Any suggestions for my stack based allocator? (Except for suggestions to use a class with private/public members)
struct Heap
{
void* heap_start;
voi
Two obvious problems:
1/ You don't have a deallocate().
2/ A deallocate() will be very hard to write with your current strategy unless you're always going to deallocate in the exact reverse order of allocating. You'll need to cater for the case where a client wants to deallocate memory in the middle of your used section.
Of course, if you do deallocate in reverse order, (2) is not a problem. And if you never free memory at all, (1) is also not a problem.
It depends on what you want it to do.