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

Initial 0.0.118.0-alpha0 C# Release #142

Merged
merged 13 commits into from
Nov 11, 2023
Merged

Conversation

TheBlueMatt
Copy link
Collaborator

It leaks memory like a sieve, but it seems to work

C# doesn't let us pass arbitrary C# objects over the FFI as a
pointer, at least not easily, so instead we need something that
looks much more like what we do for TypeScript.

Here we rewrite the trait handling in C# based on the TypeScript
code and instead store weak pointers so we can reference trait
implementation instances by a single `long`.
Using the marshallers properly will be a ton of additional work,
and its not clear we can do it in the C -> C# direction anyway.
Instead, we can trivially just use the TypeScript conversion logic
which converts everything through pointers anyway.

We'd previously done this on the C side of things, but here we do
it on the C# side as well.
Given we now do array/string conversion using the TypeScript logic
we no longer need to use the C# marshalling nonsense, which we
remove the remnants of here.
@TheBlueMatt
Copy link
Collaborator Author

@TheBlueMatt TheBlueMatt merged commit afb5ef3 into lightningdevkit:main Nov 11, 2023
3 of 10 checks passed
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