ftp.nice.ch/pub/next/graphics/3d/Raytracers.N.bs.tar.gz#/raytracers/ohta/src/alloc.c

This is alloc.c in view mode; [Download] [Up]

#include "ray.h"

char *freep=(char *)0,*endp=(char *)0,*malloc();

#define ALLOCUNIT 16384

char *myalloc(s)
int s;
{int size;
char *a;
	if(s>ALLOCUNIT)
		size=s;
	else
		size=ALLOCUNIT;
	a=malloc((unsigned)size);
	if(a==0)
	{	perror("malloc");
		exit(1);
	}
	freep=a+s;
	endp=a+size;
	return a;
}

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.