* gc.c (ruby_stack_check): STACK_LENGTH should be less than

STACK_LEVEL_MAX.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17142 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2008-06-13 05:19:01 +00:00
Родитель 97c8c1fa0e
Коммит 8477860694
2 изменённых файлов: 7 добавлений и 3 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Fri Jun 13 14:18:54 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* gc.c (ruby_stack_check): STACK_LENGTH should be less than
STACK_LEVEL_MAX.
Fri Jun 13 12:55:37 2008 Yukihiro Matsumoto <matz@ruby-lang.org> Fri Jun 13 12:55:37 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
* enum.c (sort_by_i): use NODE_DOT2 instead of NODE_MEMO to avoid * enum.c (sort_by_i): use NODE_DOT2 instead of NODE_MEMO to avoid

5
gc.c
Просмотреть файл

@ -236,7 +236,6 @@ rb_objspace_alloc(void)
/*#define HEAP_SIZE 0x800 */ /*#define HEAP_SIZE 0x800 */
#define HEAP_OBJ_LIMIT (HEAP_SIZE / sizeof(struct RVALUE)) #define HEAP_OBJ_LIMIT (HEAP_SIZE / sizeof(struct RVALUE))
#define FREE_MIN 4096
extern st_table *rb_class_tbl; extern st_table *rb_class_tbl;
VALUE *rb_gc_stack_start = 0; VALUE *rb_gc_stack_start = 0;
@ -818,11 +817,11 @@ ruby_stack_check(void)
int ret; int ret;
rb_thread_t *th = GET_THREAD(); rb_thread_t *th = GET_THREAD();
SET_STACK_END; SET_STACK_END;
ret = STACK_LENGTH > STACK_LEVEL_MAX + GC_WATER_MARK; ret = STACK_LENGTH > STACK_LEVEL_MAX - GC_WATER_MARK;
#ifdef __ia64 #ifdef __ia64
if (!ret) { if (!ret) {
ret = (VALUE*)rb_ia64_bsp() - th->machine_register_stack_start > ret = (VALUE*)rb_ia64_bsp() - th->machine_register_stack_start >
th->machine_register_stack_maxsize/sizeof(VALUE) + GC_WATER_MARK; th->machine_register_stack_maxsize/sizeof(VALUE) - GC_WATER_MARK;
} }
#endif #endif
return ret; return ret;