www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/03/16/08:07:12

Date: Thu, 16 Mar 2000 12:00:49 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Yoda <french DOT cat AT worldonline DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: memory allocating
In-Reply-To: <8aot1m$93n$1@antares.worldonline.fr>
Message-ID: <Pine.SUN.3.91.1000316120032.3117N-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: dj-admin AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Wed, 15 Mar 2000, Yoda wrote:

> When the amout of memory is too big , malloc returns a null pointer.

How much memory does your program need, approximately?  Compare that
with what the go32-v2 program prints when invoked with no arguments,
and you will see if you have enough DPMI memory on your system to run
this program.  If you do not have enough memory, you cannot solve this
by changing the way you allocate memory.

If go32-v2 prints low numbers, you could use the advice in the FAQ to
make more of it available.  (The specific sections in the FAQ depend
on your OS and memory manager.)

> I'd like to know if there is other ways to allocate memory. Maybe with dpmi
> functions ? I couldnt find doc on it.

The docs is the libc.info.  But you don't want to mess with DPMI
memory-allocating functions, believe me.  It's best to begin by
assessing how much memory do you have and how much do you need.

> I used to program c with
> borland Turboc , there was only malloc and xms. I couldnt load big
> objects...

I suggest to read chapter 15 of the DJGPP FAQ, it might help you to
understand the issues better.  DJGPP is a far cry from Borland's
real-mode compilers.

- Raw text -


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