
Signature
Iain Downs (DirectShow MVP)
Commercial Software Therapist
www.idcl.co.uk
Iain,
>The impression I have from the docs is that marshalling an array from clr
>to C++ requires (at best) a bit copy. This would effectively double the
>amount of memory I would need which could be a serious problem.
>
>Am I correct that there is a memory copy and is there any way of getting
>round this?
An array of a blittable type such as int or double doesn't need to be
copied, it can simply be pinned for the duration of the native call.
If the C++ library returns an array in native memory, you either have
to copy it into a managed array or use C# unsafe code to use it.
Mattias

Signature
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.