link-grammar-5.8.0/link-grammar/memory-pool.c
/**
 * Reuse the given memory pool.
 * Reset the pool pointers without freeing its memory.
 * pool_alloc() will then reuse the existing pool blocks before allocating
 * new blocks.
 */
Reuse the given memory pool.
Reset the pool pointers without freeing its memory.
pool_alloc() will then reuse the existing pool blocks before allocating
new blocks.
Reuse the given memory pool . Reset the pool pointers without freeing its memory . pool_alloc () will then reuse the existing pool blocks before allocating new blocks .
void pool_reuse(Pool_desc *mp)
{
	lgdebug(+D_MEMPOOL, "Reuse %zu elements (pool '%s' created in %s())\n",
	        mp->curr_elements, mp->name, mp->func);
	mp->ring = mp->chain;
	mp->alloc_next = mp->ring;
	mp->curr_elements = 0;
#ifdef POOL_FREE
	mp->free_list = NULL;
#endif 
}
void pool_reuse ( Pool_desc * mp ) { lgdebug ( + D_MEMPOOL , " \n " , mp -> curr_elements , mp -> name , mp -> func ) ; mp -> ring = mp -> chain ; mp -> alloc_next = mp -> ring ; mp -> curr_elements = 0 ; #ifdef POOL_FREE mp -> free_list = NULL ; #endif }
Reuse the given memory pool.
Reuse the given memory pool .
// POOL_FREE