L
Lee Crabtree
Pinning a regular managed array is pretty easy in C++/CLI, such as:
if buffer is defined thusly:
array<System::Byte^> buffer
pinning it would be something like:
pin_ptr<unsigned char> pinBuf = &buffer[0];
What I'm curious about, though, is whether or not it's possible to pin a
generic collection in a similar manner. The app I'm working on will be
moving REALLY big buffers between managed and unmanaged memory (to be
sent down USB), and creating a copy of the collection (with
List.ToArray()) would make a copy of the buffer, and I'd rather not
double my data usage, if I can avoid it.
Lee Crabtree
if buffer is defined thusly:
array<System::Byte^> buffer
pinning it would be something like:
pin_ptr<unsigned char> pinBuf = &buffer[0];
What I'm curious about, though, is whether or not it's possible to pin a
generic collection in a similar manner. The app I'm working on will be
moving REALLY big buffers between managed and unmanaged memory (to be
sent down USB), and creating a copy of the collection (with
List.ToArray()) would make a copy of the buffer, and I'd rather not
double my data usage, if I can avoid it.
Lee Crabtree