Bug 979913: Conditionally define PAGE_SIZE, r=khuey

With this patch the PAGE_SIZE value from the system is used if
possible. The code still assumes that the PAGE_SIZE is 4096, but
emits a warning if the actual value differs. If page size is not
defined by the system, it is set to 4096 bytes and a warning is
emitted as well.
This commit is contained in:
Thomas Zimmermann 2014-03-14 09:24:04 +01:00
parent aea66889b6
commit 69fdcaadac

View File

@ -142,7 +142,12 @@ TLSInfoList;
* methods or do large allocations on the stack to avoid stack overflow.
*/
#ifndef NUWA_STACK_SIZE
#define PAGE_SIZE 4096
#if !defined(PAGE_SIZE)
#warning "PAGE_SIZE not defined, using 4096 bytes"
#define PAGE_SIZE 4096ul
#elif PAGE_SIZE != 4096ul
#warning "System page size not 4096 bytes"
#endif
#define PAGE_ALIGN_MASK 0xfffff000
#define NUWA_STACK_SIZE (1024 * 128)
#endif