コード例 #1
0
ファイル: MiniRuntime.cs プロジェクト: yowl/SeeSharpSnake
        private static unsafe void EnsureClassConstructorRun(ref StaticClassConstructionContext context)
        {
            // Very simplified class constructor runner. In real world, the class constructor runner
            // would need to be able to deal with potentially multiple threads racing to initialize
            // a single class, and would need to be able to deal with potential deadlocks
            // between class constructors.

            if (context.initialized == 1)
            {
                return;
            }

            context.initialized = 1;

            // Run the class constructor.
            Call <int>(context.cctorMethodAddress);
        }
コード例 #2
0
ファイル: MiniRuntime.cs プロジェクト: yowl/SeeSharpSnake
 private static unsafe IntPtr CheckStaticClassConstructionReturnNonGCStaticBase(ref StaticClassConstructionContext context, IntPtr nonGcStaticBase)
 {
     EnsureClassConstructorRun(ref context);
     return(nonGcStaticBase);
 }
コード例 #3
0
ファイル: MiniRuntime.cs プロジェクト: limiha/sharpfire
 private static unsafe object CheckStaticClassConstructionReturnGCStaticBase(ref StaticClassConstructionContext context, object gcStaticBase)
 {
     CheckStaticClassConstruction(ref context);
     return(gcStaticBase);
 }