Move all array and finalizer functionality into the GC#20698
Move all array and finalizer functionality into the GC#20698thewilsonator merged 6 commits intodlang:masterfrom
Conversation
|
Thanks for your pull request, @schveiguy! Bugzilla referencesYour 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 locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + dmd#20698" |
073a737 to
10dda78
Compare
10dda78 to
d370a11
Compare
handled by allocating an empty array with metadata!
|
OK, I think I got the issue fixed with the latest commit. Let's see if there are any more... |
|
I think there was a non-deterministic test in druntime depending on the GC to collect some specific memory, let's see if this fixes it. The buildkite failure from sociomantic, I have no idea. If that keeps happening, I'll have to investigate. |
|
sociomantic swarm was just updated, that's why it's breaking: sociomantic-tsunami/swarm#439 |
|
buildkite is going to fail until this is merged: sociomantic-tsunami/swarm#440. Other than that I think this is good now. Realized that I messed up the multi-dimensional array allocator, but there was no official unittest for a 3-dim array! Only the doc builder/autotest caught it! So I added a unittest for it. |
|
FYI, I'm going to make a PR for the changelog for all the GC changes separately. It will be one entry, but relate to all the PRs. |
This also removes almost all dependency of the block metadata usage from rt.lifetime, and moves it into the GC. Now, instead of using the runtime to set up the metadata, the GC does it based on the attributes passed in.
Passing in APPENDABLE sets up the used data. Passing in FINALIZE + a typeinfo that is a struct typeinfo sets up the STRUCTFINAL bit and also stores the finalizer in the block.
There are a few remnants, such as the GC calling into the runtime to finalize where the typeinfo is extracted in the runtime instead of by the GC. This will be adjusted in a further PR.
This is split into 2 commits, the first commit adds the feature to set up the metadata in the GC allocation routines. The second commit migrates all calls to use the GC API.
The second commit is quite large, and if it needs further splitting, let me know.