wm: teppich

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