Skip to content

Commit

Permalink
Adds a TODO comment in ion_allocation.c / ion_initialize_page_pool.
Browse files Browse the repository at this point in the history
Related to #242
  • Loading branch information
tgregg authored May 7, 2021
1 parent d9db32c commit 120114d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ionc/ion_allocation.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,11 @@ void _ion_free_block(ION_ALLOCATION_CHAIN *pblock)

void ion_initialize_page_pool(SIZE page_size, int free_page_limit)
{
// once the page list is in use, you can't change your mind
// This is changed, because g_ion_alloc_page_list.page_size is initialized to ION_ALLOC_PAGE_POOL_DEFAULT_PAGE_SIZE.
// TODO This is always true, causing this function to do nothing, because g_ion_alloc_page_list.page_size
// is statically initialized to ION_ALLOC_PAGE_POOL_DEFAULT_PAGE_SIZE. The original intent of this check
// (when it was != ) was to attempt to determine whether the page pool had already been initialized,
// however the check was insufficient. The problem of how to safely allow users to configure the page
// pool exactly once needs to be solved. See https://github.com/amzn/ion-c/issues/242 .
if (g_ion_alloc_page_list.page_size == ION_ALLOC_PAGE_POOL_DEFAULT_PAGE_SIZE)
{
return;
Expand Down

0 comments on commit 120114d

Please sign in to comment.