wm: teppich

ref: fcc77109aec85decb2ec7e7c41af203b4ae0f12f
dir: /libc/free.c/

View raw version
#include <u.h>
#include <mem.h>

void
free(void *mem)
{
	int i;

	i = (((int)(mem) - MEM_BEG ) / BLOCKSIZE)+1;
	while(memap[i])
	{
		memap[i] = 0;
		*(char*)mem++ = '\0';
		i++;
	}
}