449 |
|
#endif |
450 |
|
} |
451 |
|
|
452 |
+ |
/* Returns the size of a page. */ |
453 |
+ |
|
454 |
+ |
int vm_page_size(void) |
455 |
+ |
{ |
456 |
+ |
#ifdef _WIN32 |
457 |
+ |
return 4096; |
458 |
+ |
#else |
459 |
+ |
return getpagesize(); |
460 |
+ |
#endif |
461 |
+ |
} |
462 |
+ |
|
463 |
|
#ifdef CONFIGURE_TEST_VM_MAP |
464 |
|
/* Tests covered here: |
465 |
|
- TEST_VM_PROT_* program slices actually succeeds when a crash occurs |
470 |
|
vm_init(); |
471 |
|
|
472 |
|
#define page_align(address) ((char *)((unsigned long)(address) & -page_size)) |
473 |
< |
#ifdef _WIN32 |
463 |
< |
const unsigned long page_size = 4096; |
464 |
< |
#else |
465 |
< |
unsigned long page_size = getpagesize(); |
466 |
< |
#endif |
473 |
> |
unsigned long page_size = vm_page_size(); |
474 |
|
|
475 |
|
const int area_size = 6 * page_size; |
476 |
|
volatile char * area = (volatile char *) vm_acquire(area_size); |