adjust alignment calculation

- I think this used to overallocate when the alignment was already met
This commit is contained in:
Bennet Bleßmann
2024-07-06 00:13:46 +02:00
parent dd2548453b
commit 7509cc1a07

View File

@@ -371,8 +371,7 @@ impl AtomTable {
}
let size = mem::size_of::<AtomHeader>() + string.len();
let align_offset = 8 * mem::align_of::<AtomHeader>();
let size = (size & !(align_offset - 1)) + align_offset;
let size = size.next_multiple_of(AtomTable::align());
unsafe {
let len_ptr = loop {