www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/07/03/13:07:33

Date: Thu, 3 Jul 1997 18:54:40 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: csgcty AT singnet DOT com DOT sg
cc: djgpp AT delorie DOT com
Subject: Re: Memory allocation
In-Reply-To: <199707030213.KAA30265@mallow.singnet.com.sg>
Message-ID: <Pine.SUN.3.91.970703185116.1458N-100000@is>
MIME-Version: 1.0

On Thu, 3 Jul 1997 csgcty AT singnet DOT com DOT sg wrote:

> I just started using DJGPP and I'm a little confused about memory
> allocation. There appears to be a few ways to allocate memory : using the
> new operator, using __dpmi_allocate_dos_memory,
> __dpmi_allocate_linear_memory, __dpmi_allocate_memory,
> __dpmi_allocate_shared_memory. Could someone tell me which one I should use
> and what is the difference between them ? I need to allocate about 1-2 MB. 

Use `malloc' and forget about the rest for the time being.  In the long 
run, the only one you would need besides `malloc' is 
`__dpmi_allocate_dos_memory'.  The rest are only required for VERY 
low-level stuff, which most users don't need.

> I know the following will be painfully obvious to some people, but how is it
> possible ( In the sense of I know how it is done but I would like to know
> why it is allowed) to be able to just set a descriptor to point to the video
> ram ? Does this mean that I can just point anywhere and just write anywhere ?

Download the DJGPP FAQ list (v2/faq210b.zip from the same place you get 
DJGPP) and read section 18.4 there which explains how to do that.

- Raw text -


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