Skip to content

atom_table: fix inverted rehash load-factor check - #2372

Open
pguyot wants to merge 1 commit into
atomvm:release-0.7from
pguyot:w29/atom-table-rehash-fix
Open

atom_table: fix inverted rehash load-factor check#2372
pguyot wants to merge 1 commit into
atomvm:release-0.7from
pguyot:w29/atom-table-rehash-fix

Conversation

@pguyot

@pguyot pguyot commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Invert the condition: grow once the load factor would exceed the threshold.

Add a test-structs regression test that bulk-inserts many atoms in batches and verifies each is retrievable by index and by name.

These changes are made under both the "Apache 2.0" and the "GNU Lesser General
Public License 2.1 or later" license terms (dual license).

SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later

@pguyot
pguyot force-pushed the w29/atom-table-rehash-fix branch from e1bfee4 to 4028aec Compare July 20, 2026 19:36

@bettio bettio left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, this PR fails to build on macOS.

Invert the condition: grow once the load factor would exceed the threshold.

Add a test-structs regression test that bulk-inserts many atoms in batches and
verifies each is retrievable by index and by name.

Signed-off-by: Paul Guyot <pguyot@kallisys.net>
@pguyot
pguyot force-pushed the w29/atom-table-rehash-fix branch from 4028aec to 0d8ffe8 Compare July 25, 2026 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants