From: "John M. Aldrich" 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: Reply-To: fighteer AT cs DOT com NNTP-Posting-Host: ppp243.cs.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk 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 | ---------------------------------------------------------------------