From e3bb7c0d2521a5202504de33b377f8774dcb36ed Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Sun, 27 Oct 2024 14:19:28 +1100 Subject: [PATCH] Renamed a macro --- source/toy_stack.c | 2 +- source/toy_stack.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/toy_stack.c b/source/toy_stack.c index 5e809ec..80a8459 100644 --- a/source/toy_stack.c +++ b/source/toy_stack.c @@ -72,7 +72,7 @@ Toy_Value Toy_popStack(Toy_Stack** stackHandle) { } //shrink if possible - if ((*stackHandle)->count > TOY_STACK_INITIAL_CAPACITY && (*stackHandle)->count < (*stackHandle)->capacity * TOY_STACK_CONTRACTION_RATE) { + if ((*stackHandle)->count > TOY_STACK_INITIAL_CAPACITY && (*stackHandle)->count < (*stackHandle)->capacity * TOY_STACK_CONTRACTION_THRESHOLD) { (*stackHandle)->capacity /= 2; unsigned int newCapacity = (*stackHandle)->capacity; diff --git a/source/toy_stack.h b/source/toy_stack.h index 21735ea..c4d9742 100644 --- a/source/toy_stack.h +++ b/source/toy_stack.h @@ -25,8 +25,8 @@ TOY_API Toy_Value Toy_popStack(Toy_Stack** stackHandle); #define TOY_STACK_EXPANSION_RATE 2 #endif -#ifndef TOY_STACK_CONTRACTION_RATE -#define TOY_STACK_CONTRACTION_RATE (1 / 4) +#ifndef TOY_STACK_CONTRACTION_THRESHOLD +#define TOY_STACK_CONTRACTION_THRESHOLD (1 / 4) #endif //prevent an infinite expansion, limited to 1MB