From 392ab9d05ef90570bcc439fa3d8e66ada76ba7a7 Mon Sep 17 00:00:00 2001 From: naruse Date: Wed, 28 Jul 2010 00:25:53 +0000 Subject: [PATCH] * 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 --- ChangeLog | 6 ++++++ cont.c | 12 ++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index d9c567d58f..ebd4b8023d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Wed Jul 28 09:24:43 2010 NARUSE, Yui + + * cont.c: (RB_PAGE_SIZE): renamed from PAGE_SIZE. [ruby-dev:41870] + + * cont.c: (RB_PAGE_MASK): renamed from PAGE_MASK. + Tue Jul 27 23:09:09 2010 Tanaka Akira * ext/pathname/pathname.c (path_taint): use rb_obj_taint. diff --git a/cont.c b/cont.c index 17f0ccc617..db2a5a81b3 100644 --- a/cont.c +++ b/cont.c @@ -41,9 +41,9 @@ #include #include #include -#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"); } }