Charles Forsythcommon ld functions5f4810412 years agoHistory
48 lines · 524 B · C
RawDownload
#include	"l.h" /* * fake malloc */void*malloc(usize n){	return halloc(n);} voidfree(void *p){	USED(p);} void*calloc(usize m, usize n){	void *p; 	n *= m;	p = malloc(n);	memset(p, 0, n);	return p;} /* * not used by compiler or loader, but Windows needs it */void*realloc(void *p, usize n){	void *new; 	new = malloc(n);	if(new != nil && p != nil)		memmove(new, p, n);	/* safe only when adjecent hunks have no gaps */	return new;} voidsetmalloctag(void *v, ulong pc){	USED(v);	USED(pc);}