#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.
| 90 | /// files may still grow by (commit_growth below), bounded by any enclosing Windows Job Object memory limit. |
| 91 | /// Saturates instead of wrapping. |
| 92 | inline 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 |