From 3e09f95b40d2f0fe4ea8bf59aba6406274b0dfcd Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 11 Sep 2023 20:30:52 +0200 Subject: [PATCH] tag/Pool: enable option `zero_initialized` Commit 44beae519d1966ebf96d53f858f4ea15932d0849 caused the MPD executable to grow by more than 1 MB because the `slots` array suddenly was not zero-initialized anymore, because the doubly-linked list is circular, while the singly-linked list is zero-terminated. This option moves the array back to the `bss` section. --- src/tag/Pool.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tag/Pool.cxx b/src/tag/Pool.cxx index 006b1c35a..4fbdb43b4 100644 --- a/src/tag/Pool.cxx +++ b/src/tag/Pool.cxx @@ -46,7 +46,8 @@ TagPoolSlot::Create(TagType type, } static std::array>, + IntrusiveListMemberHookTraits<&TagPoolSlot::list_hook>, + IntrusiveListOptions{.zero_initialized = true}>, 16127> slots; static inline unsigned