malloc, sun and vax
Mike Tiberio
tiberio at seismo.UUCP
Wed Aug 1 00:01:54 AEST 1984
the following 7 liner prints nothing on our sun and prints bad malloc
on our vax. the program i condensed this from exhibited the bad malloc
symptoms under 4.1, 4.1a, 4.1c and 4.2. the sun runs the latest
version of the kernal from sun. the vax has 4 meg memory, the sun 2 meg.
i have avoided the problem by declaring an array big enough to cover my
worst case, but that makes the program a pig all the time, i would like
to use the malloc, but... any suggestions?
main() {
char *bp, *malloc();
bp = malloc(2023144);
free(bp);
if( (bp=malloc(2273888)) == 0 )
printf("bad malloc\n");
}
from the tired keys of seismo!tiberio
More information about the Comp.unix.wizards
mailing list