mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
gc.h: IS_STACK_DIR_UPPER
* gc.h (IS_STACK_DIR_UPPER): utility macro. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
068dafd21f
commit
8706c00dfd
3 changed files with 5 additions and 2 deletions
|
@ -1,4 +1,6 @@
|
|||
Sun Jun 10 17:54:31 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
Sun Jun 10 17:54:36 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* gc.h (IS_STACK_DIR_UPPER): utility macro.
|
||||
|
||||
* thread_pthread.c (get_stack): seems stack size does not include
|
||||
guard size on Mac OS X.
|
||||
|
|
1
gc.h
1
gc.h
|
@ -81,6 +81,7 @@ int ruby_get_stack_grow_direction(volatile VALUE *addr);
|
|||
#define STACK_GROW_DIR_DETECTION VALUE stack_grow_dir_detection
|
||||
#define STACK_DIR_UPPER(a,b) STACK_UPPER(&stack_grow_dir_detection, (a), (b))
|
||||
#endif
|
||||
#define IS_STACK_DIR_UPPER() STACK_DIR_UPPER(1,0)
|
||||
|
||||
#if defined __GNUC__ && __GNUC__ >= 4
|
||||
#pragma GCC visibility push(default)
|
||||
|
|
|
@ -1342,7 +1342,7 @@ ruby_stack_overflowed_p(const rb_thread_t *th, const void *addr)
|
|||
}
|
||||
size /= 5;
|
||||
if (size > water_mark) size = water_mark;
|
||||
if (STACK_DIR_UPPER(1, 0)) {
|
||||
if (IS_STACK_DIR_UPPER()) {
|
||||
if (size > ~(size_t)base+1) size = ~(size_t)base+1;
|
||||
if (addr > base && addr <= (void *)((char *)base + size)) return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue