From 7509cc1a07150c2fc4cacb20c4499c0d70219b4a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bennet=20Ble=C3=9Fmann?= Date: Sat, 6 Jul 2024 00:13:46 +0200 Subject: [PATCH] adjust alignment calculation - I think this used to overallocate when the alignment was already met --- src/atom_table.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/atom_table.rs b/src/atom_table.rs index 6de8f5f9..fbb7793a 100644 --- a/src/atom_table.rs +++ b/src/atom_table.rs @@ -371,8 +371,7 @@ impl AtomTable { } let size = mem::size_of::() + string.len(); - let align_offset = 8 * mem::align_of::(); - let size = (size & !(align_offset - 1)) + align_offset; + let size = size.next_multiple_of(AtomTable::align()); unsafe { let len_ptr = loop { -- 2.54.0