summaryrefslogtreecommitdiff
path: root/cont.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-28 00:25:53 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-28 00:25:53 +0000
commit392ab9d05ef90570bcc439fa3d8e66ada76ba7a7 (patch)
treeb51195643556344d14705662953a64966a688151 /cont.c
parent0cb17010c437232e03d8a35cda69dccddba4f4f8 (diff)
* cont.c: (RB_PAGE_SIZE): renamed from PAGE_SIZE. [ruby-dev:41870]
* cont.c: (RB_PAGE_MASK): renamed from PAGE_MASK. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'cont.c')
-rw-r--r--cont.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/cont.c b/cont.c
index 17f0ccc617..db2a5a81b3 100644
--- a/cont.c
+++ b/cont.c
@@ -41,9 +41,9 @@
#include <unistd.h>
#include <sys/mman.h>
#include <ucontext.h>
-#endif
-#define PAGE_SIZE (pagesize)
-#define PAGE_MASK (~(PAGE_SIZE - 1))
+# clean cast warnings.endif
+#define RB_PAGE_SIZE (pagesize)
+#define RB_PAGE_MASK (~(RB_PAGE_SIZE - 1))
static long pagesize;
#define FIBER_MACHINE_STACK_ALLOCATION_SIZE (0x10000 / sizeof(VALUE))
#endif
@@ -498,7 +498,7 @@ fiber_set_stack_location(void)
VALUE *ptr;
SET_MACHINE_STACK_END(&ptr);
- th->machine_stack_start = (void*)(((VALUE)ptr & PAGE_MASK) + STACK_UPPER(&ptr, 0, PAGE_SIZE));
+ th->machine_stack_start = (void*)(((VALUE)ptr & PAGE_MASK) + STACK_UPPER(&ptr, 0, RB_PAGE_SIZE));
}
static VOID CALLBACK
@@ -531,8 +531,8 @@ fiber_machine_stack_alloc(size_t size)
if (ptr == (VALUE*)(SIGNED_VALUE)-1) {
rb_raise(rb_eFiberError, "can't alloc machine stack to fiber");
}
- if (mprotect(ptr + STACK_DIR_UPPER((size - PAGE_SIZE) / sizeof(VALUE), 0),
- PAGE_SIZE, PROT_READ | PROT_WRITE) < 0) {
+ if (mprotect(ptr + STACK_DIR_UPPER((size - RB_PAGE_SIZE) / sizeof(VALUE), 0),
+ RB_PAGE_SIZE, PROT_READ | PROT_WRITE) < 0) {
rb_raise(rb_eFiberError, "mprotect failed");
}
}