src/interp/alloc.c
/*========================================
 * alloc_pnode_memory -- return new pnode memory
 * We use a custom allocator, which lowers our overhead
 * (no heap overhead per pnode, only per block)
 * and also allows us to clean them all up after the
 * report.
 * NB: This is not traditional garbage collection - we're
 *  not doing any live/dead analysis; we depend entirely
 *  on carnal knowledge of the program.
 * As far as I know, no pnodes were ever being freed before.
 * Perry Rapp, 2001/01/20
 *======================================*/
- return new pnode memory
We use a custom allocator, which lowers our overhead
(no heap overhead per pnode, only per block)
and also allows us to clean them all up after the
report.
NB: This is not traditional garbage collection - we're
not doing any live/dead analysis; we depend entirely
on carnal knowledge of the program.
As far as I know, no pnodes were ever being freed before.
- return new pnode memory We use a custom allocator which lowers our overhead ( no heap overhead per pnode only per block ) and also allows us to clean them all up after the report . NB : This is not traditional garbage collection - we ' re not doing any live / dead analysis ; we depend entirely on carnal knowledge of the program . As far as I know no pnodes were ever being freed before .
static PNODE
alloc_pnode_memory (void)
{
	PNODE node;
	if (!free_list) {
		PN_BLOCK new_block = stdalloc(sizeof(*new_block));
		INT i;
		new_block->next = block_list;
		block_list = new_block;
		for (i=0; i<(INT)BLOCK_NODES; i++) {
			PNODE node1 = &new_block->nodes[i];
			itype(node1) = IFREED;
			inext(node1) = free_list;
			free_list = node1;
		}
	}
	node = free_list;
	free_list = inext(node);
	live_pnodes++;
	return node;
}
static PNODE alloc_pnode_memory ( void ) { PNODE node ; if ( ! free_list ) { PN_BLOCK new_block = stdalloc ( sizeof ( * new_block ) ) ; INT i ; new_block -> next = block_list ; block_list = new_block ; for ( i = 0 ; i < ( INT ) BLOCK_NODES ; i ++ ) { PNODE node1 = & new_block -> nodes [ i ] ; itype ( node1 ) = IFREED ; inext ( node1 ) = free_list ; free_list = node1 ; } } node = free_list ; free_list = inext ( node ) ; live_pnodes ++ ; return node ; }
alloc_pnode_memory -- return new pnode memory
 We use a custom allocator, which lowers our overhead
 (no heap overhead per pnode, only per block)
 and also allows us to clean them all up after the
 report.
alloc_pnode_memory -- return new pnode memory We use a custom allocator which lowers our overhead ( no heap overhead per pnode only per block ) and also allows us to clean them all up after the report .
/*
	This assumes that all pnodes are scoped
	within report processing. If this ceases to
	be true, this breaks.
	*/