memory-allocators icon indicating copy to clipboard operation
memory-allocators copied to clipboard

Found a bug in StackAllocator

Open ImYellowFish opened this issue 3 years ago • 0 comments

image There seems to be a bug in this line. headerPtr = &allocationHeader;

Should be changed to *headerPtr = allocationHeader; otherwise the padding value is not recorded in the header memory. I tested the original code, and the stack head address mismatches after one allocation and one free.

image

ImYellowFish avatar Dec 02 '22 03:12 ImYellowFish