Skip to content

Conversation

@IS4Code
Copy link

@IS4Code IS4Code commented Jul 2, 2023

I've tried to update this project a bit to make it more convenient to build APIs for. There were several changes, fixes etc.

  • The project has been ported to .NET Standard 2.0. The isolated runtime remains at .NET 6, meaning it can be invoked freely from lower versions of .NET Core, and from .NET Framework.
  • IsolatedObject and other remote objects implement IDisposable, IEquatable, and similar, controlling the existence of their remote counterpart in memory (only the handles are disposed/compared ‒ if the remote object implements IDisposable or IEquatable itself, it is not called). ToString is implemented as well, but is actually routed to the remote object's ToString implementation.
    • Added IsolatedClass and abstract IsolatedMember for better reflection. IsolatedObject can be cast back and forth between IsolatedMember for runtime members inheriting from MemberInfo.
  • IsolatedMethod can be invoked with an arbitrary number of arguments. Exceptions from within the call are serialized back to the host (I am however unsure if messagepack's deserialization of Exception could be potentially dangerous).
  • IsolatedMethod can be invoked with an IsolatedObject argument, or any remote object (such as IsolatedMethod being represented as MethodInfo in the guest).
  • IsolatedMethod can be abstract or virtual, resolving to the proper concrete method when invoked on an IsolatedObject.
  • IsolatedMethod can be looked up using its full signature (as offered by Mono).
  • IsolatedMethod supports generic instantiation.
  • Class or method lookup returns null instead of an exception if not found.
  • Serialization of arguments is handled through a new implementation of IBufferWriterIsolatedAllocator, which handles reallocations of guest memory and automatically does length-prefixing.
  • Fixed valuetype handling related to unboxing.

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