Exemplo n.º 1
0
        [MethodImpl(MethodImplOptions.NoInlining)] // the JITter can attempt to inline the caller itself without worrying about us
        private static JavaScriptStringEncoderOld CreateDefaultEncoderSlow()
        {
            var onDemandEncoder = new JavaScriptStringEncoderOld();

            return(Interlocked.CompareExchange(ref _defaultEncoder, onDemandEncoder, null) ?? onDemandEncoder);
        }
Exemplo n.º 2
0
 [MethodImpl(MethodImplOptions.NoInlining)] // the JITter can attempt to inline the caller itself without worrying about us
 private static JavaScriptStringEncoderOld CreateDefaultEncoderSlow()
 {
     var onDemandEncoder = new JavaScriptStringEncoderOld();
     return Interlocked.CompareExchange(ref _defaultEncoder, onDemandEncoder, null) ?? onDemandEncoder;
 }