delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/16/23:02:15

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: How to alloc Extended memory
Date: Thu, 16 Oct 1997 19:07:31 +0000
Organization: Two pounds of chaos and a pinch of salt
Lines: 30
Message-ID: <344665F3.373F@cs.com>
References: <Pine DOT GSO DOT 3 DOT 96 DOT 971015093617 DOT 20230A-100000 AT condor DOT colombianet DOT net>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp243.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Manuel Porras wrote:
> 
> How can i allocate Extended memory ?
> I use malloc but it works only on conventional.
> I saw __dpmi_allocate_memory but i dont know how to use it
> and if it is equivalent to malloc ().

Actually, you are wrong.  DJGPP is a 32-bit protected mode compiler.  It
gives you access to all the memory on your computer, plus up to 128 MB
of virtual memory, as one contiguous memory segment.  You can malloc()
as large an object as you want and never worry about crossing segments
or running out of conventional memory.

Different DPMI hosts (cwsdpmi, Windows, Linux, OS/2) give you different
amounts of memory to work with, but you can count on at least 64
megabytes if your computer has that much RAM plus free disk space. 
cwsdpmi allows up to 128 MB physical plus 128 MB virtual for a total of
256 MB.  You can run the 'go32-v2' program provided with DJGPP to see
how much memory you have available.

Welcome to DPMI, where extended and expanded memory are things of the
past.  :)

-- 
---------------------------------------------------------------------
|      John M. Aldrich       | "Money is truthful.  If a man speaks |
|       aka Fighteer I       | of his honor, make him pay cash."    |
|   mailto:fighteer AT cs DOT com   |                                      |
| http://www.cs.com/fighteer |               - Lazarus Long         |
---------------------------------------------------------------------

- Raw text -


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