link-grammar-5.8.0/link-grammar/memory-pool.c
/*
 * Reuse the given fake memory pool by freeing its memory.
 */
Reuse the given fake memory pool by freeing its memory.
Reuse the given fake memory pool by freeing its memory .
void pool_reuse(Pool_desc *mp)
{
	if (NULL == mp) return;
	lgdebug(+D_MEMPOOL, "Reuse %zu elements (pool '%s' created in %s())\n",
	        mp->curr_elements, mp->name, mp->func);
	char *c_next;
	for (char *c = mp->chain; c != NULL; c = c_next)
	{
		ASAN_UNPOISON_MEMORY_REGION(c, mp->element_size + FLDSIZE_NEXT);
		c_next = POOL_NEXT_BLOCK(c, mp->element_size);
		free(c);
	}
	mp->chain = NULL;
	mp->curr_elements = 0;
}
void pool_reuse ( Pool_desc * mp ) { if ( NULL == mp ) return ; lgdebug ( + D_MEMPOOL , " \n " , mp -> curr_elements , mp -> name , mp -> func ) ; char * c_next ; for ( char * c = mp -> chain ; c != NULL ; c = c_next ) { ASAN_UNPOISON_MEMORY_REGION ( c , mp -> element_size + FLDSIZE_NEXT ) ; c_next = POOL_NEXT_BLOCK ( c , mp -> element_size ) ; free ( c ) ; } mp -> chain = NULL ; mp -> curr_elements = 0 ; }
Reuse the given fake memory pool by freeing its memory.
Reuse the given fake memory pool by freeing its memory .
/* Free its chained memory blocks. */