From c392e0ade36f1a5ab312066724d77b595f6846ce Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Mon, 8 Mar 2021 10:46:24 -0500 Subject: [PATCH] Replace a couple FormatterServices uses in DataContractSerialization (#49290) --- .../src/System/Runtime/Serialization/SurrogateDataContract.cs | 2 +- .../src/System/Runtime/Serialization/XmlFormatReaderGenerator.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/SurrogateDataContract.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/SurrogateDataContract.cs index ebf41ee..1cd7270 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/SurrogateDataContract.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/SurrogateDataContract.cs @@ -47,7 +47,7 @@ namespace System.Runtime.Serialization [MethodImpl(MethodImplOptions.NoInlining)] private object GetUninitializedObject(Type objType) { - return FormatterServices.GetUninitializedObject(objType); + return RuntimeHelpers.GetUninitializedObject(objType); } [MethodImpl(MethodImplOptions.NoInlining)] diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlFormatReaderGenerator.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlFormatReaderGenerator.cs index 9c5d3cf..483f803 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlFormatReaderGenerator.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlFormatReaderGenerator.cs @@ -942,7 +942,7 @@ namespace System.Runtime.Serialization internal static object UnsafeGetUninitializedObject(Type type) { - return FormatterServices.GetUninitializedObject(type); + return RuntimeHelpers.GetUninitializedObject(type); } /// -- 2.7.4