mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-01-19 07:51:03 +00:00
Fix map loading on OS X.
@DanielGibson pointed out that _SC_PAGESIZE itself is too big, _SC_PAGESIZE - 1 is correct. Also apply a small performance optimization by querying _SC_PAGESIZE only once.
This commit is contained in:
parent
cbe89b982a
commit
80ef326927
1 changed files with 2 additions and 1 deletions
|
@ -99,7 +99,8 @@ Hunk_End(void)
|
|||
n = (byte *)mremap(membase, maxhunksize, curhunksize + sizeof(size_t), 0);
|
||||
#else
|
||||
#ifndef round_page
|
||||
#define round_page(x) ((((size_t)(x)) + sysconf(_SC_PAGESIZE)) & ~(_SC_PAGESIZE))
|
||||
size_t page_size = sysconf(_SC_PAGESIZE);
|
||||
#define round_page(x) ((((size_t)(x)) + page_size-1) & ~(page_size-1))
|
||||
#endif
|
||||
|
||||
size_t old_size = round_page(maxhunksize);
|
||||
|
|
Loading…
Reference in a new issue