Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upImplement a proper bump allocator #1
Conversation
blt
merged commit 8810756
into
master
Nov 5, 2018
blt
deleted the
proper_bump
branch
Nov 5, 2018
This comment has been minimized.
This comment has been minimized.
SimonSapin
commented
Nov 5, 2018
|
Thank you for working on this! I think there may be a bug in the alignment handling. It’s not the size that needs to be rounded up, is the addressed of the returned pointer. Although the size of Rust types is always a multiple of their alignment (to make arrays work), this is not necessarily the case of |
This comment has been minimized.
This comment has been minimized.
|
@SimonSapin hey, thanks for this. I put this together without a test plan and fully believe there are bugs in it. Would you mind opening an issue? |
blt commentedNov 5, 2018
•
edited
This commit introduces a proper thread-safe bump allocator to bh_alloc. The previous allocator is now moved to the
fuzzsub-module. This work was inspired by a Reddit conversation. I felt pretty bad that my poor fuzzy allocator got held up to demonstrate a general purpose bump allocator. :)Anyway, the only dicey bit here is the AtomicUsize. I haven't done any stress testing on an ARM machine, which should be done. x86 has stricter memory ordering, hiding bugs that only turn up under ARM.
Signed-off-by: Brian L. Troutwine brian@troutwine.us