delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/26/05:16:10

Date: Sun, 26 Jul 1998 12:16:11 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: grundmann <grundema AT uni-duesseldorf DOT de>
cc: djgpp AT delorie DOT com
Subject: Re: Memory Problem
In-Reply-To: <35B8B77B.6FD08052@uni-duesseldorf.de>
Message-ID: <Pine.SUN.3.91.980726121545.26387Q-100000@is>
MIME-Version: 1.0

On Fri, 24 Jul 1998, grundmann wrote:

> I am writing an application that needs lots of memory
> How can i determin the amount of memory which i can allocate with malloc
> without getting a NULL pointer ?

The easiest way is to call `_go32_dpmi_remaining_virtual_memory' at
the very beginning of your program.  This avoids the problems with the
internal free memory pool maintained by malloc/free, whose size you
cannot know (at the beginning of the program, this pool has a
negligible size).

Beware: some DPMI servers won't allow you to allocate all of the free
memory in a single large chunk.  See the FAQ for details.

> Do i have to configure CWSDPMI sepcial to use 64 MB Ram ( or 96 MB

No.  But you may need to configure your system to allow CWSDPMI access
to more than 64MB, since some memory managers limit the memory they
make available to programs.

- Raw text -


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