In C#, you can create jagged array is an array of objects, where each object is another array. A buffer cannot contain objects. Also these individual arrays can be variable length. In order to put a jagged array into a buffer (i.e. one _flat array), we need to flatted out all the data into a memory buffer, but then have a mechanism for application code to view it as a jagged array.
I haven't created a pull request yet because I want to try it in a real-world application first, and see how it goes. There may be a few things I might want to change.
In C#, you can create jagged array is an array of objects, where each object is another array. A buffer cannot contain objects. Also these individual arrays can be variable length. In order to put a jagged array into a buffer (i.e. one _flat array), we need to flatted out all the data into a memory buffer, but then have a mechanism for application code to view it as a jagged array.
I have a possible implementation that I'm working with: https://github.com/kasajian/SharedMemory/tree/JaggedArrayDev There's unit-tests there and comments on how to use it.
I haven't created a pull request yet because I want to try it in a real-world application first, and see how it goes. There may be a few things I might want to change.