Change default block size alignment to be 4 for memory saving on 32-bit arch
For a 32-bit userspace, `struct LinkedListEntry` takes 8 bytes for
storing the two pointers, a default block allocator size alignment of
16-bytes would waste 50% of memory. By changing the alignment to size
of a pointer, it saves >1MB memory postboot on wembley device.
Bug: http://b/206889551
Test: bionic-unit-tests
Change-Id: Ie92399c9bb3971f631396ee09bbbfd7eb17dc1a7
diff --git a/linker/linker_block_allocator.h b/linker/linker_block_allocator.h
index 8ae4094..32656c7 100644
--- a/linker/linker_block_allocator.h
+++ b/linker/linker_block_allocator.h
@@ -33,6 +33,9 @@
#include <android-base/macros.h>
+static constexpr size_t kBlockSizeAlign = sizeof(void*);
+static constexpr size_t kBlockSizeMin = sizeof(void*) * 2;
+
struct LinkerBlockAllocatorPage;
/*