]>
git.cameronkatri.com Git - bsdgames-darwin.git/blob - hack/alloc.c
1 /* alloc.c - version 1.0.2 */
5 a ridiculous definition, suppressing
6 "possible pointer alignment problem" for (long *) malloc()
7 "enlarg defined but never used"
8 "ftell defined (in <stdio.h>) but never used"
13 alloc(n
) unsigned n
; {
14 long dummy
= ftell(stderr
);
15 if(n
) dummy
= 0; /* make sure arg is used */
21 extern char *malloc();
22 extern char *realloc();
26 register unsigned lth
;
30 if(!(ptr
= malloc(lth
)))
31 panic("Cannot get %d bytes", lth
);
38 register unsigned lth
;
42 if(!(nptr
= realloc(ptr
,lth
)))
43 panic("Cannot reallocate %d bytes", lth
);
44 return((long *) nptr
);