delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/03/15/20:25:04

Date: Thu, 16 Mar 2000 06:21:07 +0500
Message-Id: <200003160121.GAA00864@midpec.com>
From: Prashant TR <tr AT midpec DOT com>
To: "Yoda" <french DOT cat AT worldonline DOT com>
CC: djgpp AT delorie DOT com
In-reply-to: <8aot1m$93n$1@antares.worldonline.fr>
(french DOT cat AT worldonline DOT com)
Subject: Re: memory allocating
References: <Pine DOT SUN DOT 3 DOT 91 DOT 1000315105511 DOT 17230S-100000 AT is> <8aot1m$93n$1 AT antares DOT worldonline DOT fr>
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

"Yoda" <french DOT cat AT worldonline DOT com> writes:

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

That's the case with any malloc. When you try to exceed the amount of memory
you have, it does return NULL.

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

malloc uses DPMI functions to allocate memory.

> I know there r functions called like _dpmi_memory_allocate . I also saw
> allocate ldt ... But i dunno how to use them. I used to program c with
> borland Turboc , there was only malloc and xms. I couldnt load big
> objects...

There's no need to get into the DPMI functions at all. All you need to do is
to malloc the amount of space you need (there's no 640K or 1M limit when
you're working on DJGPP ;-)) and then grab the data into it.

- Raw text -


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