www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/02/06/14:55:26

Xref: news2.mv.net comp.os.msdos.djgpp:829
Newsgroups: comp.os.msdos.djgpp
From: kunst AT natlab DOT research DOT philips DOT com (Pieter Kunst)
Subject: Re: malloc/free ends up fragmenting dynamic memory?
Sender: news AT natlab DOT research DOT philips DOT com (USENET News System)
Message-ID: <DMCxKG.1L9@natlab.research.philips.com>
Date: Tue, 6 Feb 1996 14:00:16 GMT
References: <4f5sm8$2kt AT cardinal1 DOT Stanford DOT EDU>
Organization: Philips Research Laboratories, Eindhoven, The Netherlands
Lines: 18
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

In article <4f5sm8$2kt AT cardinal1 DOT Stanford DOT EDU> beale AT leland DOT Stanford DOT EDU (John Beale) writes:
>
> eventually ends up not being able to malloc even a mid-sized array 
                                                     ^^^^^^^^^
What size do you call mid-sized ?

> Is there a malloc_unfragment() command or equivalent?  
> How do other people handle this problem?

You could write your own malloc functions my_malloc(),
my_free() and my_collect_garbage() and only make one call
to the original malloc() at startup, and free() at exit.

There also exist several PD packages that do just this.
I don't have any pointers where to get these, however...

Pieter.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019