Wednesday 15 September 2010

c# - Preventing unmanaged function pointer garbage collection -


The document tells the documents to change the unmanaged code that I am responsible for stopping myself from the archive. I want to know this. The representative can not be collected when the delegates live without calls. For example, if I type

  unmanaged function (arg = & gt; any);   

Where the unmanaged function does not store the function beyond the pointer to its pointer. It should be legal, is not it? CMR is executing the execution without executing, while not able to collect.

According to:

Usually, There will be no need to worry about Whenever you are passing a representative of unmanaged code, CLR will ensure that the representative is alive during the call .

It looks like you're okay.

unmanagedFunction function does not store the pointer beyond its scripts.

The next paragraph however,

However, if the original code keeps a copy of the pointer beyond the duration of the call and afterwards that indicator , then you may

apply not > div>

No comments:

Post a Comment