Bug 979913: Conditionally define PAGE_SIZE, r=khuey

With this patch the PAGE_SIZE value from the system is used if
possible. If page size is not defined by the system, it is set
to 4096 bytes and a warning is emitted. PAGE_ALIGN_MASK is now
derived from PAGE_SIZE. With these changes, the code should be
more robust on systems with non-4KiB page size.
This commit is contained in:
Thomas Zimmermann 2014-03-14 11:23:51 +01:00
parent cdefdfab38
commit a0988f8236

View File

@ -142,8 +142,11 @@ TLSInfoList;
* methods or do large allocations on the stack to avoid stack overflow.
*/
#ifndef NUWA_STACK_SIZE
#define PAGE_SIZE 4096
#define PAGE_ALIGN_MASK 0xfffff000
#ifndef PAGE_SIZE
#warning "Hard-coding page size to 4096 byte
#define PAGE_SIZE 4096ul
#endif
#define PAGE_ALIGN_MASK (~(PAGE_SIZE-1))
#define NUWA_STACK_SIZE (1024 * 128)
#endif