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

Add SharedAllocatorList #10594

Merged
merged 1 commit into from
Dec 27, 2024
Merged

Conversation

0xEAB
Copy link
Member

@0xEAB 0xEAB commented Dec 26, 2024

Revamp of #6465; recreated by applying the changes to current ~master.

The unresolved reviews of the original PR haven’t been addressed yet.

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @0xEAB!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + phobos#10594"

AllocatorList!(Factory, BookkeepingAllocator) impl;
SpinLock lock = SpinLock(SpinLock.Contention.brief);

// Remove this when 'https://github.com/dlang/druntime/pull/2156' gets merged
Copy link
Contributor

Choose a reason for hiding this comment

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

does this have a corresponding dmd PR? is it still open?

Copy link
Member Author

Choose a reason for hiding this comment

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

I haven’t been able to find any successor to that druntime PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

Should we rather rephrase that note or simply remove it?

Copy link
Member Author

Choose a reason for hiding this comment

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

Theoretically, there’s dlang/dmd#17128.

Copy link
Member Author

Choose a reason for hiding this comment

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

So, I’ve replaced this comment in 45a094f.

@0xEAB 0xEAB force-pushed the shared_allocator_list branch from 971b4a1 to 4732be3 Compare December 26, 2024 06:46
Copy link
Contributor

@thewilsonator thewilsonator left a comment

Choose a reason for hiding this comment

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

Not that you need do it here, but if this allocator is advertised as thread safe then the unit tests should not be system, we should @trusted the minimal interface and have the rest be safe.

@0xEAB
Copy link
Member Author

0xEAB commented Dec 27, 2024

we should @trusted the minimal interface and have the rest be safe.

I suppose this would need a purpose-built shim as “allocators must be entirely @system.

Co-authored-by: Elias Batek <[email protected]>
@0xEAB 0xEAB force-pushed the shared_allocator_list branch from d701391 to 97f3432 Compare December 27, 2024 02:08
@thewilsonator
Copy link
Contributor

That only lists free as a function that must be @system because use after free, and double free.

@thewilsonator thewilsonator merged commit de2b97f into dlang:master Dec 27, 2024
9 checks passed
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.

4 participants