Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Found a bug in StackAllocator #27

Open
ImYellowFish opened this issue Dec 2, 2022 · 0 comments
Open

Found a bug in StackAllocator #27

ImYellowFish opened this issue Dec 2, 2022 · 0 comments

Comments

@ImYellowFish
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant