summaryrefslogtreecommitdiff
path: root/shape.h
diff options
context:
space:
mode:
authorJemma Issroff <jemmaissroff@gmail.com>2023-01-26 11:42:17 -0500
committerAaron Patterson <aaron.patterson@gmail.com>2023-02-06 08:40:51 -0800
commit28da9909849dc02abe74de8170fe4036534361ba (patch)
treec0f0b56f943a9b7c68b33099d0bb36ab82aa4113 /shape.h
parentcab8c11611d94adaa86d9ed8322dd372922f94bc (diff)
downloadruby-28da9909849dc02abe74de8170fe4036534361ba.tar.gz
Limit maximum number of IVs on a shape on T_OBJECTS
Create SHAPE_MAX_NUM_IVS (currently 50) and limit all shapes of T_OBJECTS to that number of IVs. When a shape with a T_OBJECT has more than 50 IVs, fall back to the obj_too_complex shape which uses hash lookup for ivs. Note that a previous version of this commit 78fcc9847a9db6d42c8c263154ec05903a370b6b was reverted in 88f2b94065be3fcd6769a3f132cfee8ecfb663b8 because it did not account for non-T_OBJECTS
Diffstat (limited to 'shape.h')
-rw-r--r--shape.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/shape.h b/shape.h
index 74baab4f86..240a88ab72 100644
--- a/shape.h
+++ b/shape.h
@@ -31,6 +31,7 @@ typedef uint16_t shape_id_t;
# define SHAPE_BITMAP_SIZE 16384
# define SHAPE_MAX_VARIATIONS 8
+# define SHAPE_MAX_NUM_IVS 50
# define MAX_SHAPE_ID (SHAPE_MASK - 1)
# define INVALID_SHAPE_ID SHAPE_MASK