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

Update GC interface to contain array management functions. #20608

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

schveiguy
Copy link
Member

This migrates array management primitives into the GC. Each of these functions either updates the array used space, gets the array used space, or expands an array in-place in a GC-sanctioned way.

The intent is for the array runtime to defer to the GC for these operations, and allow innovation in these areas.

The primitives will never reallocate a block in order to expand it. That must be handled via a separate call to allocation routines (currently done in the lifetime module).

I purposely did not add these to core.memory yet, as these are only useful for internal operations managing array memory. This may remain that way, or in the future, we may expose this. For now, it's an internal detail, only relevant to GC implementors.

This was split into 2 commits The first migrates all the array functions from rt.lifetime to the conservative GC. The second commit fixes issues that were found during build/test. The 2 commits will help review actual changes to the code.

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @schveiguy!

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 + dmd#20608"

@schveiguy
Copy link
Member Author

@Herringway any more comments on this? Please read the note about the trusted code.

@Herringway
Copy link
Contributor

@Herringway any more comments on this? Please read the note about the trusted code.

I'm not really satisfied, but I'm not a GC expert in any sense and don't want to delay things further.

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