From 8c36abe23a9c9e980e398171c860a6756716e124 Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 12 Mar 2008 03:52:52 +0000 Subject: * gc.c: fixed indent. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- gc.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/gc.c b/gc.c index 7d05f33d5c..56dbb3efb8 100644 --- a/gc.c +++ b/gc.c @@ -190,7 +190,8 @@ rb_global_variable(VALUE *var) void rb_memerror(void) { - static int recurse = 0; + static int recurse = 0; + if (!nomem_error || (recurse > 0 && rb_safe_level() < 4)) { fprintf(stderr, "[FATAL] failed to allocate memory\n"); exit(1); @@ -616,11 +617,11 @@ static int grow_direction; static int stack_grow_direction(VALUE *addr) { - rb_thread_t *th = GET_THREAD(); - SET_STACK_END; + rb_thread_t *th = GET_THREAD(); + SET_STACK_END; - if (STACK_END > addr) return grow_direction = 1; - return grow_direction = -1; + if (STACK_END > addr) return grow_direction = 1; + return grow_direction = -1; } # define stack_growup_p(x) ((grow_direction ? grow_direction : stack_grow_direction(x)) > 0) # define STACK_UPPER(x, a, b) (stack_growup_p(x) ? a : b) @@ -631,10 +632,10 @@ stack_grow_direction(VALUE *addr) int ruby_stack_length(VALUE **p) { - rb_thread_t *th = GET_THREAD(); - SET_STACK_END; - if (p) *p = STACK_UPPER(STACK_END, STACK_START, STACK_END); - return STACK_LENGTH; + rb_thread_t *th = GET_THREAD(); + SET_STACK_END; + if (p) *p = STACK_UPPER(STACK_END, STACK_START, STACK_END); + return STACK_LENGTH; } int -- cgit v1.2.3