
Signature
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Thanks Mattias,
Do you know if there is a big performance penalty doing it this way opposed
to using unsafe code and pointer arithmetic?
Totto
>>Is it possible to do this looping i C# without going to unsafe code?
>
> Well you can use Marshal.Copy to bring the whole array into managed
> memory at once and then iterate through that.
>
> Mattias
Mattias Sjögren - 21 Feb 2006 22:30 GMT
>Do you know if there is a big performance penalty doing it this way opposed
>to using unsafe code and pointer arithmetic?
I wouldn't think so but I suggest you measure it. Since you're making
a copy of the data, you'll of course double the amount of memory you
need.
Mattias

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