link-grammar-5.8.0/link-grammar/memory-pool.c
/**
 * Allow to reuse individual elements. They are added to a free list that is
 * used by pool_alloc() before it allocates from memory blocks.
 */
Allow to reuse individual elements. They are added to a free list that is
used by pool_alloc() before it allocates from memory blocks.
Allow to reuse individual elements . They are added to a free list that is used by pool_alloc () before it allocates from memory blocks .
void pool_free(Pool_desc *mp, void *e)
{
	assert(mp->element_size >= FLDSIZE_NEXT);
	if (NULL == e) return;
	mp->curr_elements--;
	char *next = mp->free_list;
	mp->free_list = e;
	*(char **)e = next;
	ASAN_POISON_MEMORY_REGION(e, mp->element_size);
}
void pool_free ( Pool_desc * mp , void * e ) { assert ( mp -> element_size >= FLDSIZE_NEXT ) ; if ( NULL == e ) return ; mp -> curr_elements -- ; char * next = mp -> free_list ; mp -> free_list = e ; * ( char * * ) e = next ; ASAN_POISON_MEMORY_REGION ( e , mp -> element_size ) ; }
Allow to reuse individual elements.
Allow to reuse individual elements .