Array and raw memory data RRS feed

  • Question

  • I am currently working on a WinRT extension library that should make some native C/C++ code accessible from other WinRT languages. Beside of some smaller issues (value structs not supported) I am curious what’s the recommended way to handle raw memory data blocks. I am pretty sure I need to expose them as array of some simple type like int8. That’s not a problem and I can pass such an array down from C# and the C++ code can consume it. As I need to call another function that expected a pointer to this data I am asking myself what’s the fastest solution here. I can copy the data to another block of memory by looping over the array. But I hope there is something faster. There seems to be a member function that can at least copy the contained data to a memory block. But it’s marked as for internal use. As the get function returns a reference I am tempted to use it as a pointer for my call. But would this be fine as the documentation contains no promises about the internal memory layout of the array.
    Monday, October 10, 2011 5:51 PM

All replies