MCPcopy Create free account
hub / github.com/Niko1221/Strata / commit_available

Function commit_available

engine/include/strata/platform/commit.hpp:92–96  ·  view source on GitHub ↗

#5742: the commit an allocation can still get on Windows, from what is left now (ullAvailPageFile) and what the page files may still grow by (commit_growth below), bounded by any enclosing Windows Job Object memory limit. Saturates instead of wrapping.

Source from the content-addressed store, hash-verified

90/// files may still grow by (commit_growth below), bounded by any enclosing Windows Job Object memory limit.
91/// Saturates instead of wrapping.
92inline uint64_t commit_available(uint64_t avail_now, uint64_t growth) {
93 const uint64_t sys_avail = growth > UINT64_MAX - avail_now ? UINT64_MAX : avail_now + growth;
94 const uint64_t job_avail = job_commit_room_bytes();
95 return sys_avail < job_avail ? sys_avail : job_avail;
96}
97
98/// The bytes Windows' page files may still grow by: a page file Windows manages (PagingFiles "?:\pagefile.sys", or a
99/// file's sizes "0 0") up to 3x the RAM Windows sees (4 GiB at least) and an eighth of its volume, a set one up to

Callers 7

host_available_memoryFunction · 0.85
mainFunction · 0.85
initMethod · 0.85
host_available_memoryFunction · 0.85
sample_host_memoryFunction · 0.85
mainFunction · 0.85

Calls 1

job_commit_room_bytesFunction · 0.85

Tested by 2

mainFunction · 0.68