Re: check if the memory is low, from Windows to Unix
- From: CBFalconer <cbfalconer@xxxxxxxxx>
- Date: Wed, 31 Jan 2007 09:23:25 -0500
kevin.heart@xxxxxxxxx wrote:
How to implement such function for Linux/Unix?
/* sample begins*/
#include "windows.h"
No such file in standard C.
...
MEMORYSTATUS stat;
No such macro or type has been defined.
GlobalMemoryStatus(&stat);
result = ((float)stat.dwAvailPageFile / stat.dwTotalPageFile) < 0.1;
undefined struct or union 'stat'. No such fields.
...
if (result)
trigger_low_mem_info();
Undefined function.
...
/* sample ends */
You neglected to include a description of 'such function'.
Assuming you meant to include the subject line in the message, you
find the memory is low when malloc (or calloc, or realloc) returns
NULL.
--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>
.
- References:
- check if the memory is low, from Windows to Unix
- From: kevin . heart
- check if the memory is low, from Windows to Unix
- Prev by Date: Re: Read hex string to a buf
- Next by Date: Re: check if the memory is low, from Windows to Unix
- Previous by thread: Re: check if the memory is low, from Windows to Unix
- Next by thread: Re: check if the memory is low, from Windows to Unix
- Index(es):