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

Heavily abstracted rewerite of the zerogc API for version 0.3 #34

Draft
wants to merge 36 commits into
base: master
Choose a base branch
from

Conversation

Techcable
Copy link
Member

I fell victim to one of the most classic programming blunders, wasting time with excessive abstraction.

Unfortunately, I don't think abstracting over multiple GC implementations is very necessary right now. It's a waste of time when I'm only planning on a single implementation.

It is true that language virtual machines are likely to have their own garbage collection implementations. However, there are better abstractions for that like mmtk.

A future version may add back in some of this abstraction, but for now the concrete implementation I have prototyped in Techcable/zerogc-next0.3 will work fine with some improvements.

This is intended to be a replacement/redesign for zerogc
Simplifies size calculation.

Use bumpalo for young-gen alloc
The oldgen collector is going to use a mimalloc heap
for its internal allocations.
Some strange errors with invalid Layout alignment (when using miri)
These address calculations can't really be avoided :/

This reverts commit 2f0926f95db863829159608e82bf7c5f4c98adf2
Allows using AddressSanitizer
Triggers errors earlier in AddressSanitizer
Because FFI is forbidden
This causes the to pass miri (onlt with tree borrows, not stacked borrows)
This emulates bumpalo::Bump behavior and avoids a slow HashMap
Unfortunately, miri still reports leaks
This adds some extra overhead in young-gen, but not much in old
…697c3ab'

git-subtree-dir: zerogc-nextv0.3
git-subtree-mainline: 3ff913b
git-subtree-split: 38a3b1e
In the v0.3 API, the context crate will no longer exist
and the simple crate needs to be rewritten.
The new version drops support for most features in v0.2
Will not be used with initial version of v0.3 API
Will be handled differently in v0.3 API
Doesn't delete any code right now
Reduces some features for derive macros (specifically warnings),
but is not really needed for the main crate.
Remove unused dependencies.
Only offered with special extension trait `MutableKeys`.
Drop unused `deserialize` option for macro (GcDeserialize removed).

Drop unused dependencies.
The GcHeader api allows access to an object's internal header,
which contains the CollectorId.
For an array, the header also contains the length.

Implmentations can (and will) add extra metadata to their header
like mark bits and type info.

Make methods on Gc associated functions instead of methods
in order to avoid conflicts with the Deref trait.
This is what Arc and Box both do.
@Techcable Techcable changed the title [DEAD] Heavily abstracted rewerite of the zerogc API for version 0.3 Heavily abstracted rewerite of the zerogc API for version 0.3 Jun 30, 2024
Currently doesn't compile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant