summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-06 12:22:56 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-06 12:22:56 +0000
commit302fcb568d817bed348f554f1be28951ad924449 (patch)
treec319be0a165a409f73d3b0e09eda2818106f57d5
parenta737fc8ace0d56354f618c6657d7042a7423e851 (diff)
* cont.c (fiber_machine_stack_alloc): use MAP_FAILED instead of -1.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--cont.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 976cc42..599144e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Wed Jul 6 21:22:16 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * cont.c (fiber_machine_stack_alloc): use MAP_FAILED instead of -1.
+
Wed Jul 6 21:21:05 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* cont.c (fiber_machine_stack_alloc): remove unnecessary cast.
diff --git a/cont.c b/cont.c
index e260a40..db4d93b 100644
--- a/cont.c
+++ b/cont.c
@@ -537,7 +537,7 @@ fiber_machine_stack_alloc(size_t size)
void *page;
STACK_GROW_DIR_DETECTION;
ptr = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
- if (ptr == (VALUE*)(SIGNED_VALUE)-1) {
+ if (ptr == MAP_FAILED) {
rb_raise(rb_eFiberError, "can't alloc machine stack to fiber");
}
page = ptr + STACK_DIR_UPPER((size - RB_PAGE_SIZE) / sizeof(VALUE), 0);