27 #if BEATMUP_PLATFORM_WINDOWS
33 #include <sys/statfs.h>
34 #include <sys/sysinfo.h>
44 #if BEATMUP_PLATFORM_WINDOWS
45 MEMORYSTATUSEX status;
46 status.dwLength =
sizeof(status);
47 GlobalMemoryStatusEx(&status);
48 return status.ullAvailPhys;
52 return info.freeram * info.mem_unit;
57 #if BEATMUP_PLATFORM_WINDOWS
58 MEMORYSTATUSEX status;
59 status.dwLength =
sizeof(status);
60 GlobalMemoryStatusEx(&status);
61 return status.ullTotalPhys;
65 return info.totalram * info.mem_unit;
72 DebugAssertion::check(
size > 0,
"Trying to allocate zero memory");
77 reinterpret_cast<std::uintptr_t
>(
rawAddr) + (align -
reinterpret_cast<std::uintptr_t
>(
rawAddr) % align)
98 other.rawAddr =
nullptr;
99 other.alignAddr =
nullptr;
void free()
Frees the allocated memory.
static uint64_t available()
Returns the size of available (free) operating memory in bytes.
AlignedMemory & operator=(AlignedMemory &&)
static const size_t DEFAULT_ALIGNMENT
default number of bytes to align the address
static uint64_t total()
Returns the size of total operating memory in bytes.
#define BEATMUP_DEBUG_I(...)