1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Make stack_check slightly easier to use in debugger.

This commit is contained in:
Samuel Williams 2019-07-07 22:58:55 +12:00
parent 012e954b47
commit 5c8061a9e2
No known key found for this signature in database
GPG key ID: A0765423A44728FB

7
gc.c
View file

@ -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