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 kitsune-derive and use it throughout the project #528

Merged
merged 3 commits into from
May 9, 2024
Merged

Conversation

aumetra
Copy link
Member

@aumetra aumetra commented May 9, 2024

Closes #414

In order to generally decrease the amount of memory used, we can use more Arcs.
That way we only ever have a guaranteed size of 8 bytes per service handle, and a size overhead of 16 bytes per instance (because 1 pointer, 1 atomic counter).

To simplify that implementation and to keep the neat names, this PR adds an attribute macro called kitsune_service which renames the struct, creates a new struct in its place which has one field, an triomphe::Arc which wraps the actual service implementation, and implements Deref, to all the struct fields can be accessed as-is.

In general, I hope this decreases the overall size of the state and maybe memory usage in general.

@aumetra aumetra marked this pull request as ready for review May 9, 2024 15:19
@aumetra aumetra merged commit 03e8ca3 into main May 9, 2024
20 checks passed
@aumetra aumetra deleted the kitsune-derive branch May 9, 2024 15:24
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.

Use more Arcs internally
1 participant