summaryrefslogtreecommitdiff
path: root/variable.c
diff options
context:
space:
mode:
authorAaron Patterson <tenderlove@ruby-lang.org>2022-09-27 11:51:34 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2022-10-19 07:54:46 -0700
commiteeea633eb20cfdcaf0fec35109afa3821cb994f3 (patch)
tree2f68ec48fcb1e710dcafc2e92e28c0780404981f /variable.c
parent412e3c7a8db275567eaceece6c48dde3aedf2ae6 (diff)
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.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/6585
Diffstat (limited to 'variable.c')
-rw-r--r--variable.c3
1 files changed, 0 insertions, 3 deletions
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