Article View: net.micro.atari16
Article #1557malloc() problem
From: Stefan Brantschen
Date: Fri, 15 Aug 1986 14:45
Date: Fri, 15 Aug 1986 14:45
33 lines
1004 bytes
1004 bytes
Has anybody ever had problems with malloc() (DRI C)?
Consider the following piece of code:
long free_mem;
struct midi_event
{ int delay;
char midi_msgs[3];
} buffer;
main()
{
struct event *malloc();
free_mem = (long)malloc(-1L);
buffer = malloc(free_mem);
/* error handling ..... */
printf("%ld bytes free",free_mem);
........
........
}
What I get is "879000 bytes free" on a 1040 with a 600k RAM disk
installed....????
Any hint?
Thanks Stefan Brantschen
...cernvax!hslrswi!hslraxe!brantsch
Technical Details
Message-ID:
<155@hslrswi.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!seismo!mcvax!cernvax!hslrswi!brantschShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!mcvax!cernvax!hslrswi!brantsch From: brantsch@hslrswi.UUCP (Stefan Brantschen) Newsgroups: net.micro.atari16 Subject: malloc() problem Message-ID: <155@hslrswi.UUCP> Date: Fri, 15-Aug-86 10:45:48 EDT Article-I.D.: hslrswi.155 Posted: Fri Aug 15 10:45:48 1986 Date-Received: Wed, 20-Aug-86 08:26:33 EDT Organization: Hasler AG, Bern, Switzerland Lines: 34