POV-Ray : Newsgroups : povray.programming : Memory? : Re: Memory? Server Time
28 Jul 2024 18:19:48 EDT (-0400)
  Re: Memory?  
From: Steve H 
Date: 18 Aug 1999 15:37:40
Message: <37bb0a9c.23790166@news.povray.org>
On 8 Aug 1999 07:00:57 -0400, Nieminen Mika <war### [at] cctutfi> wrote:

>"Steve Horn <horn <dot> 74 @ osu" <"dot> edu."> wrote:
>: I have recently discovered that POV_MALLOC() is just a
>: container-function for the regular ANSI C function malloc().  Since when
>: has malloc() been able to access EMS?
>
>  I think it doesn't. The compiler (djgpp, watcom or whatever) just calls
>the dpmi driver which does the allocations. Since it works in 32-bit protected
>mode, all the memory is available directly, without needing to use ems-pages.
>  For example, this is entirely possible in djgpp and watcom:
>malloc(100*1024*1024) /* allocate 100 Megs of memory */
>  This works even if you have less than 100 Megs of physical RAM (the dpmi
>driver creates a swap file).
>  As I said, djgpp and watcom work in 32-bit protected mode, so there's no
>64KB segment limits nor 640KB memory limit. You can allocate any amount
>of any sized memory blocks (up to 4 Gigabytes). They don't call the DOS
>memory allocation routines but the dpmi driver routines.
>

Okay...that sounds good.  Now how can one get the amount of free
physical RAM left in EMS?   There seems to be no function in any of my
compilers to get this number.  (I have Borland Turbo C++ 3.0, MS Quick
C,  and MS Visual C++ v6.0... and Borland C++ 5.0 on disk not loaded
on my HD.)

Any suggestions?


---------------
Steve H.

>-- 
>main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
>):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.