зеркало из https://github.com/github/ruby.git
* 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
This commit is contained in:
Родитель
a737fc8ace
Коммит
302fcb568d
|
@ -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.
|
||||
|
|
2
cont.c
2
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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче