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

Date: Thu, 3 Jul 1997 10:42:24 -0700 (PDT)
Message-Id: <199707031742.KAA02475@adit.ap.net>
Mime-Version: 1.0
To: csgcty AT singnet DOT com DOT sg
From: Nate Eldredge <eldredge AT ap DOT net>
Subject: Re: Memory allocation
Cc: djgpp AT delorie DOT com

You 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. 

Is there some reason you can't just use malloc? This is the most portable
and simplest way to allocate memory, and all the low-level DPMI stuff is
done for you.
>
>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 ?

Essentially, yes. You can do so even more blatantly with
__djgpp_nearptr_enable, which makes your DS selector access the *entire
address space*. Note that this doesn't work under Windows NT, which has the
sense to forbid unreasonable descriptors.

>One last thing, how do I subscribe to other newsgroups ? How would I find
>their servers ?

Many newsgroups don't have an associated mailing list. Us E-mail only folks
are lucky in that regard about DJGPP. You will have to research each one
individually. Ideas: try to get the FAQ; get newsgroup access. 

HTH

Nate Eldredge
eldredge AT ap DOT net



- Raw text -


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