A
AMercer
I have a legacy C dll that I call from VB .net, and I'm unsure about when
pinning is necessary. The called functions in the dll run on a worker thread.
The case I am worried about is an array of doubles. I have an array 'dim
x(10) as double'. I call a C function with x(0) passed byref, and the C
function expects double*. This works fine, but I don't know if array x needs
to be pinned. In other words, I may have a bug that will eventually bite me
when GC and my call run concurrently. Does anyone know whether pinning is
necessary or not in this setting?
pinning is necessary. The called functions in the dll run on a worker thread.
The case I am worried about is an array of doubles. I have an array 'dim
x(10) as double'. I call a C function with x(0) passed byref, and the C
function expects double*. This works fine, but I don't know if array x needs
to be pinned. In other words, I may have a bug that will eventually bite me
when GC and my call run concurrently. Does anyone know whether pinning is
necessary or not in this setting?