Skip to content

bli_pool: add sanity check in bli_pool_free_block()#565

Closed
hominhquan wants to merge 1 commit intoflame:masterfrom
hominhquan:pool_reinit_sanity
Closed

bli_pool: add sanity check in bli_pool_free_block()#565
hominhquan wants to merge 1 commit intoflame:masterfrom
hominhquan:pool_reinit_sanity

Conversation

@hominhquan
Copy link
Copy Markdown
Contributor

Details:

  • In case of pool reinit due to a thread asking for a bigger block, the
    pool is re-initialized and all blocks are free-ed, including potential
    ones already checked out and being used elsewhere. Those empty slots
    are marked with NULL pointer and hence we should skip calling free()
    on them (with subtraction by offset_size).
  • The orphaned blocks and their pointers will be free-ed later when
    checking in back by the existing check-in mechanism.

Details:
- In case of pool reinit due to a thread asking for a bigger block, the
  pool is re-initialized and all blocks are free-ed, including potential
  ones already checked out and being used elsewhere. Those empty slots
  are marked with NULL pointer and hence we should skip calling free()
  on them (with subtraction by offset_size).
- The orphaned blocks and their pointers will be free-ed later when
  checking in back by the existing check-in mechanism.
@devinamatthews
Copy link
Copy Markdown
Member

@hominhquan I believe the problems leading to this PR were fixed recently in #670 and #671. If not, let me know.

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

Successfully merging this pull request may close these issues.

2 participants