summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Valentine-House <matt@eightbitraptor.com>2026-04-06 22:37:30 +0100
committerMatt Valentine-House <matt@eightbitraptor.com>2026-04-09 13:24:09 +0100
commitc91977801797ef15a97aa2f325c7458ef393166b (patch)
treed07659bdd0c55b8ce5e857e48706ce3e69256d3f
parent3c28bb53a7447c1e8b88da1ccbae76801d5b643a (diff)
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
-rw-r--r--shape.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/shape.c b/shape.c
index 93ccd3eb59..c9169313cf 100644
--- a/shape.c
+++ b/shape.c
@@ -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)) {