ref: 4695d500412add95b4ca42cbb224bf15bf21873e dir: /libc/free.c/
#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++; } }