I would like to pass a C # link to C / C ++ code (pointer) and then return it from a pointer to a C # link. I have a lot of pairs (uint, Object). I created a sorting mechanism in C code because it is much faster than C #. There is only a key (uint) and a value (object reference). C code uses the key to sort and does not change the value (pointer). Is there an easy way to do this? Do I need to use sorting? Function C will be called many times (maybe even a million times), so I'm afraid that it will be too slow, and I donβt even know how to do this with sorting. I believe that when the address of an object changes by GC, the address of the C # link does not change. Thus, it will not be necessary to place the object in invented memory. I'm right? Now I can call the C function using DllImport, I can save the C # link to the C pointer, but I can not get the address stored in the C pointer to the C # link.
Any ideas on how to do this?
source share