delorie.com/djgpp/doc/libc/libc_438.html | search |
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
#include <dpmi.h int _go32_dpmi_get_free_memory_information(_go32_dpmi_meminfo *info); |
This function fills in the following structure:
typedef struct { u_long available_memory; u_long available_pages; u_long available_lockable_pages; u_long linear_space; u_long unlocked_pages; u_long available_physical_pages; u_long total_physical_pages; u_long free_linear_space; u_long max_pages_in_paging_file; u_long reserved[3]; } _go32_dpmi_meminfo; |
The only field that is guaranteed to have useful data is
available_memory
. Any unavailable field has -1 in it.
Zero on success, nonzero on failure.
ANSI/ISO C | No |
POSIX | No |
int phys_mem_left() { _go32_dpmi_meminfo info; _go32_dpmi_get_free_memory_information(&info); if (info.available_physical_pages != -1) return info.available_physical_pages * 4096; return info.available_memory; } |
webmaster | delorie software privacy |
Copyright © 2004 | Updated Apr 2004 |