In a C# to native lib CLI/C++ wrapper, I have a choice:
- Store native pointer in a managed class (native object is created using native "new")
or
- Store native object as a data blob in a managed class' field, and use
pin_ptr
to pin it before each native use.
Has anyone done any comparative analysis on the relative performance costs of the two paths?
Thanks!