[net.micro.atari16] DRI C malloc

kegel@JULIET.CALTECH.EDU (Dan R. Kegel) (05/11/86)

Hello, world!
Has anybody run into the following problem with malloc() under DRI C?
The program
	main()
	{
		int	i;
		extern char *malloc();

		appl_init();	/* optional */
		for (i=1; i<16; i++)
			printf("malloc() returns %lx\n", malloc(i));
	}
produces output whose high word is always 0 or 0xffff- i.e. is getting
sign-extended somewhere- and whose low word looks reasonable- i.e. increments
by 16 with each call.  Worse yet, on the eigth or so call, malloc() starts
returning NULL, even though gobs and gobs of memory are available, and
the DOS call Malloc() has no trouble allocating 1K before the loop...
WHAT THE HELL IS GOING ON?  Maybe I should just use the DOS malloc, eh?
Thanks in advance.
Daniel Kegel
USMAIL: 1-60 Caltech, Pasadena, California 91126, USA (to June '86)
ARPA:	kegel@juliet.caltech.edu  (or kegel%juliet@hamlet.caltech.edu)
UUCP:	{seismo!} hamlet.caltech.edu!kegel%juliet.caltech.edu {@seismo.css.gov}
BITNET: kegel%juliet@caltech.bitnet