[util] Integrate sys_mem into the build

Nicely, all that was needed was a couple of includes and renaming the
functions.
This commit is contained in:
Bill Currie 2023-07-04 14:39:36 +09:00
parent d9362e81ae
commit 5000004f7d
3 changed files with 9 additions and 9 deletions

View file

@ -131,6 +131,8 @@ size_t Sys_PageSize (void);
void *Sys_Alloc (size_t size);
void Sys_Free (void *mem, size_t size);
int Sys_LockMemory (void *mem, size_t size);
size_t Sys_PeakRSS (void);
size_t Sys_CurrentRSS (void);
int Sys_ProcessorCount (void);

View file

@ -82,6 +82,7 @@ libs_util_libQFutil_la_SOURCES= \
libs/util/sizebuf.c \
libs/util/string.c \
libs/util/sys.c \
libs/util/sys_mem.c \
libs/util/va.c \
libs/util/ver_check.c \
libs/util/wad.c \

View file

@ -4,6 +4,9 @@
* License: Creative Commons Attribution 3.0 Unported License
* http://creativecommons.org/licenses/by/3.0/deed.en_US
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#if defined(_WIN32)
#include <windows.h>
@ -29,16 +32,14 @@
#error "Cannot define getPeakRSS( ) or getCurrentRSS( ) for an unknown OS."
#endif
#include "QF/sys.h"
/**
* Returns the peak (maximum so far) resident set size (physical
* memory use) measured in bytes, or zero if the value cannot be
* determined on this OS.
*/
size_t getPeakRSS( )
size_t Sys_PeakRSS (void)
{
#if defined(_WIN32)
/* Windows -------------------------------------------------- */
@ -76,15 +77,11 @@ size_t getPeakRSS( )
#endif
}
/**
* Returns the current resident set size (physical memory use) measured
* in bytes, or zero if the value cannot be determined on this OS.
*/
size_t getCurrentRSS( )
size_t Sys_CurrentRSS (void)
{
#if defined(_WIN32)
/* Windows -------------------------------------------------- */