|
cwist
Modern C web framework with libttak runtime
|
Cross-platform helpers for estimating available RAM and low-memory pressure. More...
#include <cwist/sys/sys_info.h>#include <cwist/core/macros.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>
Go to the source code of this file.
Macros | |
| #define | _POSIX_C_SOURCE 200809L |
Functions | |
| uint64_t | cwist_get_available_ram (void) |
| Fallback RAM estimate for unsupported platforms. | |
| bool | cwist_is_ram_critical (uint64_t threshold_bytes) |
| Check whether the current available RAM is below a caller-supplied threshold. | |
Cross-platform helpers for estimating available RAM and low-memory pressure.
Definition in file sys_info.c.
Definition at line 1 of file sys_info.c.
Fallback RAM estimate for unsupported platforms.
Get the available (free + reclaimable) system RAM in bytes.
Definition at line 90 of file sys_info.c.
References CWIST_GIB.
Referenced by cwist_is_ram_critical(), and cwist_nuke_init().
Check whether the current available RAM is below a caller-supplied threshold.
Check if system RAM is critically low.
| threshold_bytes | Threshold in bytes that marks memory as critical. |
Definition at line 100 of file sys_info.c.
References cap, and cwist_get_available_ram().