Rizin
unix-like reverse engineering framework and cli tools
sysinfo-memory.c File Reference
#include "uv.h"
#include "internal.h"
#include <stdint.h>
#include <sys/sysinfo.h>

Go to the source code of this file.

Functions

uint64_t uv_get_free_memory (void)
 
uint64_t uv_get_total_memory (void)
 

Function Documentation

◆ uv_get_free_memory()

uint64_t uv_get_free_memory ( void  )

Definition at line 28 of file sysinfo-memory.c.

28  {
29  struct sysinfo info;
30 
31  if (sysinfo(&info) == 0)
32  return (uint64_t) info.freeram * info.mem_unit;
33  return 0;
34 }
RzBinInfo * info(RzBinFile *bf)
Definition: bin_ne.c:86
static const char struct stat static buf struct stat static buf static vhangup int struct rusage static rusage sysinfo
Definition: sflib.h:147
unsigned long uint64_t
Definition: sftypes.h:28

References info(), and sysinfo.

◆ uv_get_total_memory()

uint64_t uv_get_total_memory ( void  )

Definition at line 36 of file sysinfo-memory.c.

36  {
37  struct sysinfo info;
38 
39  if (sysinfo(&info) == 0)
40  return (uint64_t) info.totalram * info.mem_unit;
41  return 0;
42 }

References info(), and sysinfo.