home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Altsys Virtuoso 2.0K
/
virtuoso_20k.iso
/
DemoApps
/
Graphics
/
Viewers
/
raytracers
/
ohta
/
Source
/
alloc.c
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
NeXTSTEP
RISC OS
UTF-8
Wrap
C/C++ Source or Header
|
1991-10-08
|
299 b
|
24 lines
#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;
}