#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <libp.h>

extern FREELIST *_mallocchains[MEMCHAINS];

void free(void *buf)
{
	FREELIST *p, **c;
	int size;
	if (!buf)
		return;
	p = buf;
	p-- ;
	c = &_mallocchains[(p->size>>2) % MEMCHAINS];
	p->next = *c;
	(*c) = p;
}