From 9464f2ca23937508108adb2295574f31696c91fe Mon Sep 17 00:00:00 2001 From: Alessandro Mauri Date: Mon, 13 Mar 2023 20:11:43 +0100 Subject: [PATCH] add a way to disable stack hashing --- text_rendering/generic_stack.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/text_rendering/generic_stack.h b/text_rendering/generic_stack.h index 85d0216..b3d5f1e 100644 --- a/text_rendering/generic_stack.h +++ b/text_rendering/generic_stack.h @@ -8,6 +8,9 @@ // FIXME: find a way to not re-hash the whole stack when removing one item // incremental hash for every grow +#if STACK_DISABLE_HASH +#define STACK_HASH(p, s, h) {} +#else #define STACK_HASH(p, s, h) \ { \ unsigned char *v = (unsigned char *)(p); \ @@ -20,6 +23,7 @@ (h) ^= (h) >> 11; \ (h) += (h) << 15; \ } +#endif // TODO: add a rolling hash