-
Notifications
You must be signed in to change notification settings - Fork 194
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
Problem with min_block_size
#109
Comments
Good catch, thanks. This was probably exposed by #105.
This is on purpose to catch buffer overflow in debug mode yes.
Adding a |
Sure thing, will take a stab a it. |
Should be fixed now. For simplicity (and to get rid of lots of potential bugs, if there are any), I've just removed debug fences from the pools. If needed, I can add them back later. |
The calculation for
memory_pool::min_block_size
seems wrong in some cases.Here is a failing test I added to
test/memory_pool.cpp
:This fails with:
This seems to be due to
ordered_free_memory_list::insert_impl
usingactual_size = node_size + 2 * fence_size()
, butmin_block_size
does not do the same calculation. Specifically,ordered_free_memory_list::fence_size()
givesnode_size_
as the fence size. I don't fully understand this, but it definitely seems to be on purpose.I'm happy to work on a fix for this, but I wonder if you have a recommended approach.
My initial idea is to somehow expose the "actual_size" computation, so it is accessible via
memory_pool::pool_type::XXX
, but interested in other ideas.The text was updated successfully, but these errors were encountered: