wm: teppich

ref: d94edd4b9a13e1ead5782c72753f3a6b5b02f2a6
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++;
	}
}