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

void *realloc(void *buf, size_t size)
{
	char *ptr = malloc(size);
	if (ptr && buf) {							/* borland C allows buf to be zero... */
		int oldsize = (((FREELIST *)buf)-1)->size - sizeof(size_t);
		if (oldsize > size)
			oldsize = size ;
		memcpy(ptr,buf,oldsize);
		free(buf);
	}
	return ptr;
}