mirror of
https://github.com/ruby/ruby.git
synced 2026-10-29 00:46:26 +08:00
Remove extra sentinel from shape capacities
This isn't a 0 terminated list anymore because we iterate over heaps_count directly. So we don't need to allocate an extra byte for the sentinel
This commit is contained in:
1 parent
3c28bb53a7
commit
c919778017
1 file changed
+1
-2
Notes:
git
2026-04-09 12:25:07 +00:00
@@ -1539,8 +1539,7 @@ Init_default_shapes(void)
|
||||
while (heap_sizes[heaps_count]) {
|
||||
heaps_count++;
|
||||
}
|
||||
attr_index_t *capacities = ALLOC_N(attr_index_t, heaps_count + 1);
|
||||
capacities[heaps_count] = 0;
|
||||
attr_index_t *capacities = ALLOC_N(attr_index_t, heaps_count);
|
||||
size_t index;
|
||||
for (index = 0; index < heaps_count; index++) {
|
||||
if (heap_sizes[index] > sizeof(struct RBasic)) {
|
||||
|
||||
Reference in new issue
Block a user