]>
git.cameronkatri.com Git - bsdgames-darwin.git/blob - hack/alloc.c
2 static char rcsid
[] = "$NetBSD: alloc.c,v 1.3 1995/03/23 08:29:14 cgd Exp $";
8 a ridiculous definition, suppressing
9 "possible pointer alignment problem" for (long *) malloc()
10 "enlarg defined but never used"
11 "ftell defined (in <stdio.h>) but never used"
16 alloc(n
) unsigned n
; {
17 long dummy
= ftell(stderr
);
18 if(n
) dummy
= 0; /* make sure arg is used */
24 extern char *malloc();
25 extern char *realloc();
29 register unsigned lth
;
33 if(!(ptr
= malloc(lth
)))
34 panic("Cannot get %d bytes", lth
);
41 register unsigned lth
;
45 if(!(nptr
= realloc(ptr
,lth
)))
46 panic("Cannot reallocate %d bytes", lth
);
47 return((long *) nptr
);