www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/04/11:30:47

From: SuSaNNa <_susanna_ AT yahoo DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: I CAN'T FREE MY MEMORY
Date: Fri, 04 Sep 1998 17:27:13 +0200
Organization: Netsat Systems SA
Lines: 43
Message-ID: <35F006D1.D89@yahoo.com>
References: <199809040315 DOT XAA14876 AT delorie DOT com>
NNTP-Posting-Host: caladan.arrakis.es
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

George Foot wrote:
> 
> On  4 Sep 98 at 3:28, SuSaNNa wrote:
> 

> > well, but if i need to "reality" free my memory, What can i do?
> 
> Allocate it yourself using DPMI functions to obtain a memory block
> from the DPMI server, and free it yourself when you've finished with
> it.  Look up `__dpmi_allocate_memory' and `__dpmi_free_memory' if
> you really need to do this, but why do you really care whether or
> not the memory is really free?  It'll be paged to disk sooner or
> later because it's not being used any more.  In a single-tasking
> environment, your program is the only one running, and your program
> can reuse the memory so there's no problem.  By far the most common
> multitasking environment is Windows, which is relatively stingy with
> memory anyway.  It only offers you memory out of a certain quota
> anyway, so there's probably plenty left even if you burned up
> everything it offered you.



Well, thanks George, now i understand the diference between malloc and
__dpmi_allocate_memory, but i'm using allegro library (a wonderfull
library) and allegro uses malloc() and free() to allocate bitmap
structure and bitmap data, when i repeatly load and free diferents
bitmaps of diferents sizes i see that the dpmi not reuse all available
memory.

My program uses about 60Mb of graphic data and i have only 16Mb of ram
and i don't have free
hard disk  space, i load graphics in blocks of 10Mb maximum, a block of
graphics for
every stage of my game, and when i load and free repeatly, the memory
manager crash. Why?.
You saidme that when i free a malloc, dpmi can reuse the space by
another malloc, but if i load the
blocks in a maximum of 10Mb and i have 16Mb, ¿why the system crash?.

please helpme.

Thanks for readme. sorry for my bad english, and sorry if i'm asking for
an obvious answer.

- Raw text -


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