What's wrong with alloca()?
|
Stack-based in sense of technology-based not in sense of usage of real stack.
No, i need to do that for pool of
different objects. I shouldn't only apply align in declaration/definition of object/variable but also apply to
current pointer, which refers to current accesabe memory in pool. Since objects are different i must apply alignement each time i request memory.
E.g.
0) Have pool of 64 bytes aligned to 64. Pointer
curr points to end.
1) Request one char (1 bytes with alignment=1) => after that
curr points to end-1.
2) Request one int (4 bytes with alignment=4)=>
curr points to end-8 i.e.
[end-8, end-5] goes for int and [end-4, end-2] just padded.
So, which type of pointer should be to safely apply that "logical and"?