www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/13/12:05:15

Date: Mon, 13 Jan 1997 17:41:19 +0100 (MET)
From: Grzegorz Ludorowski <pajonk AT ajax DOT umcs DOT lublin DOT pl>
To: kagel AT dg1 DOT bloomberg DOT com
cc: djgpp AT delorie DOT com
Subject: Re: how to free memory?
In-Reply-To: <9701091833.AA13864@quasar.bloomberg.com >
Message-ID: <Pine.LNX.3.95.970113173110.29760A-100000@ajax.umcs.lublin.pl>
MIME-Version: 1.0

> Another option is to wrapper malloc() and free(), etc and keep track yourself
> of the currently allocated and/or freed memory blocks in a local data structure
> maintained by the wrapper functions.  (Remember that malloc()
> requests/allocates memory blocks with their size rounded up to the next power
> of 2!)
> 
Ok. So I have to set some variables everytime I allocate or deallocate
memory. It's clear. Besides, I don't know why have I to do that on my own?
IMHO it should be done by djgpp... but ok - I can do it. (what will
happened if I could not ?) But one thing sounds VERY strange to me:
I can't allocate .. say 9MB of ram because when I will do that, djgpp will
allocate 16MB.. am I right? It rounds up everything to the next power of
2? So what will happened if I'd like to allocate 10x 300kb? It will change
to 10x512kb of allocated memory? 
If this is true [..censored..]. 
				LUDO.
PS. Or maybe I'm too lame to use djgpp :))


- Raw text -


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