From 5c8061a9e2a34df975846d724273cb5be7d74a7c Mon Sep 17 00:00:00 2001 From: Samuel Williams Date: Sun, 7 Jul 2019 22:58:55 +1200 Subject: [PATCH] Make `stack_check` slightly easier to use in debugger. --- gc.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gc.c b/gc.c index 4e1e4ee9d6..a5e11f8032 100644 --- a/gc.c +++ b/gc.c @@ -4385,11 +4385,12 @@ ruby_stack_length(VALUE **p) static int stack_check(rb_execution_context_t *ec, int water_mark) { - int ret; SET_STACK_END; - ret = STACK_LENGTH > STACK_LEVEL_MAX - water_mark; - return ret; + size_t length = STACK_LENGTH; + size_t maximum_length = STACK_LEVEL_MAX - water_mark; + + return length > maximum_length; } #else #define stack_check(ec, water_mark) FALSE