www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/11/29/14:12:47

From: "John S. Fine" <johnfine AT erols DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Djgpp doesn't free the memory? What am I doing wrong?
Date: Sun, 29 Nov 1998 14:05:03 -0500
Lines: 52
Message-ID: <36619ADF.7EB5@erols.com>
References: <36594f0d DOT 209084 AT news DOT jet DOT es> <365F0263 DOT 27D0 AT erols DOT com> <365fdc75 DOT 11836619 AT news DOT jet DOT es> <36606410 DOT 351A AT erols DOT com> <366132cd DOT 4602741 AT news DOT jet DOT es>
Mime-Version: 1.0
X-Trace: b0HyGUE6tqk//nUjBVGQbNohCs6ovseb4i8p415fG0c=
X-Complaints-To: abuse AT rcn DOT com
NNTP-Posting-Date: 29 Nov 1998 19:06:01 GMT
X-Mailer: Mozilla 3.01 (Win95; U)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Grzegorz Adam Hankiewicz wrote:

> Huh, quite horrible IMHO. I don't have the sources of libc, could you
> please tell me how are these chunk "limits" from a size of 10K to 1
> Mb?

  Above 4K, the boundary sizes are each a power of two plus 4092.
In other words the range ((1<<N)+4092) through ((2<<N)+4091)
share a pool of chunks.  For smaller chunks I didn't compute
the rule.  You can download the sources of libc yourself:

ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2/djlsr201.zip

  I forget where I got lgp271s.zip from.  I looked today at
Simtel and found:

ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/lgp2811s.zip

instead.  I haven't downloaded it, but I expect it includes
a malloc.c that will work as well as the one in 271.  If it
doesn't, or you can't download it, I can email you the
malloc.c from 271.

ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/

> >a free-source malloc.c in lgp271s.zip. I simply included that malloc.c
> >in the gcc command to build your program and the result worked
> >perfectly.
> 
> Could you tell me exactly what files do I have to link with the
> source? Oh, and I believe I will also need the C++ compiler, right?

  I don't have the C++ compiler, so you must not need it.

> Since Allegro uses Djgpp's malloc's, do you know how could I make the
> lib to use the other malloc instead?

  This malloc is fully compatible with the rest of libc.  You don't
need anything other than the malloc.c.  If you include the malloc.c
in your gcc command it will be used in place of the malloc in libc.
If you are using an explicit ld command you can put the malloc.o
before libc and get the same result.

  I am sure it is possible to replace the malloc.o inside
libc.a with the new one.  If you do it that way, you would
have the new one all the time without changing your gcc or
ld commands.  I don't happen to know how to use (or even
the name of) the program that manipulates .a files, but I
am sure it is documented.
-- 
http://www.erols.com/johnfine/
http://www.geocities.com/SiliconValley/Peaks/8600/

- Raw text -


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