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

Mark sweep free list allocates high address cells first #1164

Open
qinsoon opened this issue Jul 9, 2024 · 0 comments
Open

Mark sweep free list allocates high address cells first #1164

qinsoon opened this issue Jul 9, 2024 · 0 comments

Comments

@qinsoon
Copy link
Member

qinsoon commented Jul 9, 2024

When we allocate a new block or sweep a block, the free list for the block points to the last cell.

block.store_free_list(final_cell);

self.store_free_list(last);

E.g. for a block starting at 0x10000 and ending at 0x20000, with the cell size of 8, the free list is like below:
0x1fff8 -> 0x1fff0 -> 0x1ffe8 -> ... -> 0x10000

So when we allocate, we will get the high address cell first, then the low address cell. I am not sure if this would cause any issue. But clearly we cannot assume that in two consecutively allocated objects, the second object has a higher address than the first object.

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