Article View: net.micro.atari16
Article #642DRI C malloc
From: Dan R. Kegel
Date: Sun, 11 May 1986 05:12
Date: Sun, 11 May 1986 05:12
24 lines
1583 bytes
1583 bytes
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
Technical Details
Message-ID:
<860510221202.005@Juliet.Caltech.Edu>Path:
arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!ucbvax!JULIET.CALTECH.EDU!kegelShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site ucbvax.BERKELEY.EDU Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!ucbvax!JULIET.CALTECH.EDU!kegel From: kegel@JULIET.CALTECH.EDU (Dan R. Kegel) Newsgroups: net.micro.atari16 Subject: DRI C malloc Message-ID: <860510221202.005@Juliet.Caltech.Edu> Date: Sun, 11-May-86 01:12:24 EDT Article-I.D.: Juliet.860510221202.005 Posted: Sun May 11 01:12:24 1986 Date-Received: Tue, 13-May-86 00:43:49 EDT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet Lines: 24