Message-ID: From: "Cristovao Braga" To: "djgpp list" Subject: quick malloc question Date: Sat, 1 Mar 1997 23:37:36 -0300 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit I was wondering: if I allocate some memory with malloc () or an equivalent function and then quit the program without calling free (), will this memory be freed automatically? I searched the djgpp docs and all I could find was this: "This function allocates a chunk of memory from the heap large enough to hold any object that is SIZE bytes in length. This memory must be returned to the heap with `free' (*note free::.)." Please note that it says "must". Then I conducted the following test: I run the program which source is below under both Win95 and plain DOS with CWSDPMI. My computer has 32 MB of RAM and in both cases I run it about 30 times in a row. The available memory as reported by MEM.EXE did not shrink a single bit nor there was a single indication of virtual memory usage like disc activity. Any comments? Cristovao Braga. --- starts here --- #include char *p; main () { p = (char *) malloc (5 * 1024 * 1024); }