Mail Archives: djgpp/2000/09/26/15:51:07
> From: "Rafael Garca" <rafael AT geninfor DOT com>
> Newsgroups: comp.os.msdos.djgpp
> Date: Tue, 26 Sep 2000 19:57:07 +0200
>
> Edmund Horner <ejrh AT paradise DOT net DOT nz> escribi en el mensaje de noticias
> 969973140 DOT 340672 AT shelley DOT paradise DOT net DOT nz...
> > I understand that even if you allocate a block bigger than you have free
> > memory, the DPMI service won't actually start the virtual memory up until
> > you actually _use_ it.
>
> O.K., but this does not make a solution. I have no chance to decide if using
> RAM o disk.
Of course, it does; of course, you do: just test the return value of
malloc, and if it's NULL, you don't have that much memory.
If you want to know about physical memory alone, that is only possible
on plain DOS, e.g. by calling __dpmi_get_free_memory_information. (On
Windows, this function frequently lies, and even if it didn't, the
free memory could change behind your back as a result of other
programs running at the same time.)
- Raw text -