> Unmanaged arrays should come witha performance boost. Everytime you
> reference an element in a Managed array the framework needs to do a
[quoted text clipped - 9 lines]
>>
>> performance?
You will need to convert your unmanaged array to a managed array.
Fortunately there is a class in the System::Runtime::InteropServices
namespace that will help with this called Marshal. Here is code snippet that
should work:
property array<int>^ ManagedArr{
array<int>^ get() {
//We need to create an IntPtr that wraps arr in order to use Marshal
IntPtr arrPtr(arr);
array<int>^ managedArr = gcnew array<int>(ARRAY_SIZE);
Marshal::Copy(arrPtr, managedArr, 0, ARRAY_SIZE);
return arrPtr;
}
}
> I have a unmanaged array declared with:
>
[quoted text clipped - 19 lines]
> >>
> >> performance?
buu - 27 Sep 2007 23:43 GMT
it seems ok, but after that, inside the class, I have a memset(arr) command,
and I got an memory corruption error.
> You will need to convert your unmanaged array to a managed array.
> Fortunately there is a class in the System::Runtime::InteropServices
[quoted text clipped - 36 lines]
>> >>
>> >> performance?
buu - 27 Sep 2007 23:44 GMT
it seems ok, but after that, inside the class, I have a memset(arr) command,
and I got an memory corruption error.
> You will need to convert your unmanaged array to a managed array.
> Fortunately there is a class in the System::Runtime::InteropServices
[quoted text clipped - 36 lines]
>> >>
>> >> performance?
buu - 27 Sep 2007 23:44 GMT
it seems ok, but after that, inside the class, I have a memset(arr) command,
and I got an memory corruption error.
> You will need to convert your unmanaged array to a managed array.
> Fortunately there is a class in the System::Runtime::InteropServices
[quoted text clipped - 36 lines]
>> >>
>> >> performance?