Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not early return on null bucket_ptr #68

Merged
merged 1 commit into from
Feb 20, 2024

Conversation

Swatinem
Copy link
Contributor

@Swatinem Swatinem commented Feb 7, 2024

Buckets are allocated on demand based on Thread::bucket. This means that when only threads with a high id (and thus high bucket) are writing entries into the ThreadLocal, only higher buckets will be allocated, and lower buckets will be null.

Thus we must not early-return when encounting a null bucket.


This seems to be a regression introduced in #51 and #53, and should fix #54.

@Amanieu
Copy link
Owner

Amanieu commented Feb 20, 2024

LGTM once CI is fixed by #69.

Buckets are allocated on demand based on `Thread::bucket`.
This means that when only threads with a high `id` (and thus high `bucket`) are writing entries into the `ThreadLocal`,
only higher `buckets` will be allocated, and lower buckets will be `null`.

Thus we must not early-return when encounting a `null` bucket.
@Swatinem Swatinem mentioned this pull request Feb 20, 2024
@Amanieu Amanieu merged commit 0c2163c into Amanieu:master Feb 20, 2024
1 check passed
@Swatinem Swatinem deleted the no-early-return branch February 21, 2024 08:38
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.

Tests occasionally fail (Apple M2 Max)
2 participants