From eeea633eb20cfdcaf0fec35109afa3821cb994f3 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 27 Sep 2022 11:51:34 -0700 Subject: Stop zeroing memory on allocation / copy Shapes gives us an almost exact count of instance variables on an object. Since we know the number of instance variables that have been set, we will never access slots that haven't been initialized with an IV. --- variable.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'variable.c') diff --git a/variable.c b/variable.c index 8d329d7900..d83b8487a7 100644 --- a/variable.c +++ b/variable.c @@ -1404,9 +1404,6 @@ rb_ensure_iv_list_size(VALUE obj, uint32_t len, uint32_t newsize) newptr = obj_ivar_heap_realloc(obj, len, newsize); } - for (; len < newsize; len++) { - newptr[len] = Qundef; - } #if USE_RVARGC ROBJECT(obj)->numiv = newsize; #else -- cgit v1.2.3