Skip to content

Add SharedAllocatorList#10594

Merged
thewilsonator merged 1 commit intodlang:masterfrom
0xEAB:shared_allocator_list
Dec 27, 2024
Merged

Add SharedAllocatorList#10594
thewilsonator merged 1 commit intodlang:masterfrom
0xEAB:shared_allocator_list

Conversation

@0xEAB
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 <desisma@heidel.beer>
@0xEAB 0xEAB force-pushed the shared_allocator_list branch from d701391 to 97f3432 Compare December 27, 2024 02:08
@thewilsonator
Copy link
Copy Markdown
Contributor

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

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