Skip to content

User/kythant/add functional type marshaling#2248

Closed
kythant wants to merge 25 commits intostaging/3.0from
user/kythant/AddFunctionalTypeMarshaling
Closed

User/kythant/add functional type marshaling#2248
kythant wants to merge 25 commits intostaging/3.0from
user/kythant/AddFunctionalTypeMarshaling

Conversation

@kythant
Copy link
Copy Markdown

@kythant kythant commented Feb 12, 2026

No description provided.

manodasanW and others added 25 commits February 11, 2026 18:46
This reverts commit 4a3832e.
Co-authored-by: Sergio Pedri <sergio0694@live.com>
* Add string array marshaling support for pass array

* Introduce HStringHeader and refactor marshalling

Add a new HStringHeader struct for fast-pass HSTRING headers and refactor array marshalling to use it. Move HSTRING_HEADER to an internal type with public union fields to expose the underlying layout, remove the array conversion/Dispose helpers from HStringMarshaller, and implement array-specific ConvertToUnmanagedUnsafe and Dispose in HStringArrayMarshaller. Update code generation (code_writers.h) to allocate/pool HStringHeader arrays and call HStringArrayMarshaller accordingly. These changes separate single-value and array marshalling logic, tighten pinning requirements, and improve pooling behavior.

---------

Co-authored-by: Sergio Pedri <sergio0694@live.com>
Wrap the GetOrCreateObjectForComInstance call in a try/finally and always reset the shared state fields (ObjectComWrappersCallback, UnsealedObjectComWrappersCallback, CreateObjectTargetInterfacePointer) to null. This ensures those fields are cleared even on exceptions so subsequent calls or external callbacks (e.g. from a WeakReference<T>) won't observe stale state and cause incorrect behavior.
* Fix reference count issues

* Super nits

---------

Co-authored-by: Sergio Pedri <sergio0694@live.com>
@kythant kythant force-pushed the user/kythant/AddFunctionalTypeMarshaling branch from 77ea73b to c972217 Compare February 12, 2026 22:50
@kythant kythant closed this Feb 12, 2026
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.

3 participants