Is it possible with flatbuffers
in C# to serialize objects to native (unmanaged) memory buffer?
So I want to do these steps:
- Allocate a native memory buffer from native memory
- Create objects in C# and serialize them into the allocated buffer
- Send this memory buffer to C++ for deserialization
I'm thinking either of some custom memory buffer allocator in C#, or of some way of transferring ownership of a memory buffer form C# to C++.
In general I want to avoid copying memory when sending data from C# to C++ and vice versa. I want this memory buffer to be shared between C# and C++.
How do I do that?