Ejemplo n.º 1
0
        static public void Recycle(TypeSystemContext context)
        {
            // Only cache a reasonably small context that is still in Gen0
            if (context.LoadFactor > 200 || GC.GetGeneration(context) > 0)
                return;

            // Flush the type system context from all types being recycled
            context.FlushTypeBuilderStates();

            // No lock needed here - the reference assignment is atomic
            s_cachedContext.Target = context;
        }