- C#, C♯, C#相談室 Part87 [転載禁止]©2ch.net
622 :545[sage]:2015/05/23(土) 05:57:30.49 ID:YAXRIJCD - デリゲートもGCHandleも関数ポインタも全部フィールドに持っておくことにしました。
| - C#, C♯, C#相談室 Part87 [転載禁止]©2ch.net
631 :545[sage]:2015/05/23(土) 12:05:39.60 ID:YAXRIJCD - 下の方の
Fortunately, in this case, you don't need to allocate a pinned GC handle, because the thunk is allocated in the unmanaged heap and is referencing the delegate indirectly through a reference known to the GC. Therefore, it is not possible for the thunk to move around, and native code should always be able to call the delegate through the unmanaged pointer if the delegate itself is alive. で決まりですね 納得できました。。 >545の最初の質問がアホであることが判明しましたね 関数ポインタはデリゲートのインスタンスごとにサンクとして作られるわけで、 クラスメソッドごとにあるわけじゃないってとこを勘違いしてました
| - Win32API質問箱 Build120©2ch.net
398 :デフォルトの名無しさん[sage]:2015/05/23(土) 18:38:18.33 ID:YAXRIJCD - お前が淘汰されないユルい世界に感謝しな
|
|