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

Fixed memory_pool::min_block_size calculation #110

Closed
wants to merge 1 commit into from

Commits on Apr 19, 2021

  1. Fixed memory_pool::min_block_size calculation

    Previously, memory_pool::min_block_size() would not compute true node
    size in the same way that the individual free list implementations did.
    For instance, ordered_free_memory_list uses 2*node_size as debug fence
    memory, which memory_pool was disregarding. This could result in a
    failure at runtime, if the block was too small for a full node,
    including debug fences.
    
    Now, each free_list impl exposes "actual_node_size(n)", which produces
    the true required size, given the requested node size. This function is
    the same as what's used in the real internal size computations.
    
    Also hoisted fence_size() into constexpr functions in each free_list
    implementation, as well as added an "adjusted_node_size" function, which
    is mainly for readability, to avoid having "x > y ? x : y" repeated.
    
    Test added to exercise the bug.
    jwdevel committed Apr 19, 2021
    Configuration menu
    Copy the full SHA
    b3ac9a5 View commit details
    Browse the repository at this point in the history