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

Fix short lived callback lifetimes #89

Closed
wants to merge 1 commit into from

Conversation

arg0d
Copy link
Contributor

@arg0d arg0d commented Sep 2, 2024

Alternative to #88.

I like this one better, there is 1 less dictionary lookup.

I tried to use a struct ("stack" allocated), but C# does not allow to modify struct in-place in dictionary, so modifying refcount in a struct requires 2 lookups. Compared with a single object dereference in this MR, I think object dereference is the better option?

@arg0d
Copy link
Contributor Author

arg0d commented Sep 2, 2024

Hmm, but this MR requires needless object dereference on each lookup, compared with #88 (each callback method call).

@arg0d arg0d force-pushed the kristupas/fix-callback-lifetimes-2 branch from 10741a7 to 8175b7a Compare September 2, 2024 14:42
Signed-off-by: Kristupas Antanavičius <[email protected]>
@arg0d arg0d force-pushed the kristupas/fix-callback-lifetimes-2 branch from 8175b7a to 7171b53 Compare September 2, 2024 14:45
@arg0d arg0d marked this pull request as ready for review September 2, 2024 15:00
@arg0d arg0d self-assigned this Sep 2, 2024
@arg0d arg0d marked this pull request as draft September 2, 2024 15:02
@arg0d arg0d closed this Sep 3, 2024
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