wm: teppich

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