delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/07/19/14:55:25

From: "Campbell, Rolf [SKY:1U32:EXCH]" <cp1v45 AT americasm01 DOT nt DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: malloc() and CWSDPMI 4.0
Date: Mon, 19 Jul 1999 14:29:30 -0400
Organization: Nortel Networks
Lines: 26
Message-ID: <37936E8A.DEDBAD52@americasm01.nt.com>
References: <378bbab9 DOT 22414525 AT news DOT uni-wuppertal DOT de> <378CB591 DOT 82CC6753 AT americasm01 DOT nt DOT com> <378e1f70 DOT 6963482 AT news DOT uni-wuppertal DOT de> <378E3E83 DOT 144617B0 AT americasm01 DOT nt DOT com> <3790dc42 DOT 950074 AT news DOT uni-wuppertal DOT de>
NNTP-Posting-Host: bmerhc00.ca.nortel.com
Mime-Version: 1.0
X-Mailer: Mozilla 4.6 [en] (X11; I; HP-UX B.10.20 9000/712)
X-Accept-Language: en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Winfried Salomon wrote:

> Hello Rolf,
>
> >    There is a different version of the dpmi server that doesn't use virtual
> >memory, you can bind your executable with this.
> yes, I have used CWSDPR0.EXE, but then i allocate with malloc() 64 MB
> and without 32 MB, although I habe 96 MB Ram and I must examine the
> reason.

    OK, I'm not sure if I understand what you are saying, but I'm guessing you
meant that you can only allocate 64 Megs and any attempt to get higher fails.
If that is the problem, then I have an idea.  If you use sbrk() to allocate
memory, you can get it 1 byte at a time, without worrying about malloc headers
or rounding up to a power of 2 stuff (I don't know if that is still a problem in
the current version).  Either way, you can store the value of "sbrk(0)" into a
"char*", then continuously call "sbrk(1)" until it returns an error value.  When
it returns an error, that means that your original "char*" now points to all
available ram.


--
     -Rolf Campbell (39)3-6318



- Raw text -


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