Add kitsune-derive
and use it throughout the project
#528
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #414
In order to generally decrease the amount of memory used, we can use more
Arc
s.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, antriomphe::Arc
which wraps the actual service implementation, and implementsDeref
, 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.