D
_DS
My managed code needs to shuttle an unmanaged buffer between a couple
unmanaged functions. I know this could be done via pin_ptr, and I
understand the implications re managed heap fragmentation (I'll set it
up at the start of the program and leave it).
I believe that this could also be done by old-fashioned #include
<malloc.h> with standard allocators. Is there any reason to prefer
malloc over a pinned ptr?
Given that I may need to access the buffer in C#, I was leaning toward
a pinned pointer. Is there an advantage in Malloc that would outweigh
that?
unmanaged functions. I know this could be done via pin_ptr, and I
understand the implications re managed heap fragmentation (I'll set it
up at the start of the program and leave it).
I believe that this could also be done by old-fashioned #include
<malloc.h> with standard allocators. Is there any reason to prefer
malloc over a pinned ptr?
Given that I may need to access the buffer in C#, I was leaning toward
a pinned pointer. Is there an advantage in Malloc that would outweigh
that?