且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

从C ++回调访问C#函数的访问冲突异常/崩溃.

更新时间:2022-04-12 05:11:46

我想这与/OPTIMIZATION标志无关在DEBUG构建中已存在(或已关闭),并在发布模式中进行了/rely-optimize-this. /optimization标志集下的JIT和GC行为不同.

尝试添加'volatile'(http://msdn.microsoft.com/en-us/library/x13ttww7%28VS.71%29.aspx)并将该部分标记为关键或不要对其进行优化"部分.另一条路径(我想)是-WinDBG和低级调试(毕竟并不难)
I guess it something have to do with /OPTIMIZATION flag that don't exist (or switched off) in DEBUG build and /really-optimize-this in Release mode. The difference is in JIT and GC behavior under the /optimization flag set.

 Try to add 'volatile' ( http://msdn.microsoft.com/en-us/library/x13ttww7%28VS.71%29.aspx ) and mark the section as critical or 'do-not-optimize-it' section. Another path (I guess) is - WinDBG and low-level debugging (it's not so hard after all)