wm: teppich

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