data/test/cpp/652b9d7d55175f9b59d6c6a0cab654e2ff66d3ace_memheap.cpp
static CHUNK *memheap_newchunk()
{
	CHUNK *chunk;
	char *mem;
	
	/* allocate memory */
	mem = (char*)mem_alloc(sizeof(CHUNK)+chunksize, 1);
	if(!mem)
		return 0x0;

	/* the chunk structure is located in the begining of the chunk */
	/* init it and return the chunk */
	chunk = (CHUNK*)mem;
	chunk->memory = (char*)(chunk+1);
	chunk->current = chunk->memory;
	chunk->end = chunk->memory + chunksize;
	chunk->next = (CHUNK *)0x0;
	return chunk;
}
/* allocates a new chunk to be used */
allocates a new chunk to be used
allocates a new chunk to be used
static CHUNK *memheap_newchunk()
{
	CHUNK *chunk;
	char *mem;
	mem = (char*)mem_alloc(sizeof(CHUNK)+chunksize, 1);
	if(!mem)
		return 0x0;
	chunk = (CHUNK*)mem;
	chunk->memory = (char*)(chunk+1);
	chunk->current = chunk->memory;
	chunk->end = chunk->memory + chunksize;
	chunk->next = (CHUNK *)0x0;
	return chunk;
}
static CHUNK * memheap_newchunk ( ) { CHUNK * chunk ; char * mem ; mem = ( char * ) mem_alloc ( sizeof ( CHUNK ) + chunksize , 1 ) ; if ( ! mem ) return 0x0 ; chunk = ( CHUNK * ) mem ; chunk -> memory = ( char * ) ( chunk + 1 ) ; chunk -> current = chunk -> memory ; chunk -> end = chunk -> memory + chunksize ; chunk -> next = ( CHUNK * ) 0x0 ; return chunk ; }
allocates a new chunk to be used
allocates a new chunk to be used
/* allocate memory */ /* the chunk structure is located in the begining of the chunk */ /* init it and return the chunk */