示例#1
0
static void rem_memblock(MemHead *memh)
{
	remlink(membase,&memh->next);
	if (memh->prev){
		if (memh->next) MEMNEXT(memh->prev)->nextname = MEMNEXT(memh->next)->name;
		else MEMNEXT(memh->prev)->nextname = 0;
	}

	totblock--;
	mem_in_use -= memh->len;
	free(memh);
}
示例#2
0
static void rem_memblock(MemHead *memh)
{
	remlink(membase,&memh->next);
	if (memh->prev) {
		if (memh->next)
			MEMNEXT(memh->prev)->nextname = MEMNEXT(memh->next)->name;
		else
			MEMNEXT(memh->prev)->nextname = NULL;
	}

	totblock--;
	mem_in_use -= memh->len;

	if(memh->mmap) {
		mmap_in_use -= memh->len;
		if (munmap(memh, memh->len + sizeof(MemHead) + sizeof(MemTail)))
			printf("Couldn't unmap memory %s\n", memh->name);
	}
	else {
		if(malloc_debug_memset && memh->len)
			memset(memh+1, 255, memh->len);
		free(memh);
	}
}