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

Return references to objects, where appropriate #858

Merged
merged 6 commits into from
Jul 21, 2022
Merged

Return references to objects, where appropriate #858

merged 6 commits into from
Jul 21, 2022

Conversation

hannobraun
Copy link
Owner

Update the kernel APIs that return objects, to return references to them instead, where appropriate. This has the following advantages:

  • It makes the potential cost of copying/cloning the object explicit.
  • It avoids the cost of copying/cloning the object, where that's not needed.
  • It helps in some use cases, for example when working with trait objects, where your only alternative to using a reference is putting them in a Box (or similar).

@hannobraun hannobraun enabled auto-merge July 21, 2022 10:02
@hannobraun hannobraun merged commit e43a1f2 into main Jul 21, 2022
@hannobraun hannobraun deleted the refs branch July 21, 2022 10:04
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.

1 participant