Skip to content
This repository
Browse code

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
  • Loading branch information...
commit 8706c00dfd65ae6c78f6fdac3688b224925c8d49 1 parent 068dafd
Nobuyoshi Nakada nobu authored

Showing 3 changed files with 5 additions and 2 deletions. Show diff stats Hide diff stats

  1. +3 1 ChangeLog
  2. +1 0  gc.h
  3. +1 1  thread_pthread.c
4 ChangeLog
... ... @@ -1,4 +1,6 @@
1   -Sun Jun 10 17:54:31 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
  1 +Sun Jun 10 17:54:36 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
  2 +
  3 + * gc.h (IS_STACK_DIR_UPPER): utility macro.
2 4
3 5 * thread_pthread.c (get_stack): seems stack size does not include
4 6 guard size on Mac OS X.
1  gc.h
@@ -81,6 +81,7 @@ int ruby_get_stack_grow_direction(volatile VALUE *addr);
81 81 #define STACK_GROW_DIR_DETECTION VALUE stack_grow_dir_detection
82 82 #define STACK_DIR_UPPER(a,b) STACK_UPPER(&stack_grow_dir_detection, (a), (b))
83 83 #endif
  84 +#define IS_STACK_DIR_UPPER() STACK_DIR_UPPER(1,0)
84 85
85 86 #if defined __GNUC__ && __GNUC__ >= 4
86 87 #pragma GCC visibility push(default)
2  thread_pthread.c
@@ -1342,7 +1342,7 @@ ruby_stack_overflowed_p(const rb_thread_t *th, const void *addr)
1342 1342 }
1343 1343 size /= 5;
1344 1344 if (size > water_mark) size = water_mark;
1345   - if (STACK_DIR_UPPER(1, 0)) {
  1345 + if (IS_STACK_DIR_UPPER()) {
1346 1346 if (size > ~(size_t)base+1) size = ~(size_t)base+1;
1347 1347 if (addr > base && addr <= (void *)((char *)base + size)) return 1;
1348 1348 }

0 comments on commit 8706c00

Please sign in to comment.
Something went wrong with that request. Please try again.