POV-Ray : Newsgroups : povray.programming : Memory? : Re: Memory? Server Time
28 Jul 2024 18:25:31 EDT (-0400)
  Re: Memory?  
From: Mark Wagner
Date: 19 Aug 1999 02:31:10
Message: <37bba4ae@news.povray.org>
Steve H. wrote in 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.)


Download the source code to Fractint and borrow the EMS/XMS assembly
routines from the general.asm file, or just include the general.obj file in
your project and call the EMS/XMS routines.

Mark


Post a reply to this message

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