Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/aspnet/MessagePack-CSharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/MessagePack/MessagePackSerializer.cs')
-rw-r--r--src/MessagePack/MessagePackSerializer.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/MessagePack/MessagePackSerializer.cs b/src/MessagePack/MessagePackSerializer.cs
index 637369e4..4a6ec987 100644
--- a/src/MessagePack/MessagePackSerializer.cs
+++ b/src/MessagePack/MessagePackSerializer.cs
@@ -79,7 +79,7 @@ namespace MessagePack
/// <returns>A byte array with the serialized value.</returns>
public byte[] Serialize<T>(T value, IFormatterResolver resolver = null)
{
- using (var sequence = new Sequence<byte>())
+ using (var sequence = new Sequence<byte>(MemoryPoolWithMinSize.Instance))
{
this.Serialize(sequence, value, resolver);
return sequence.AsReadOnlySequence.ToArray();
@@ -94,7 +94,7 @@ namespace MessagePack
/// <param name="resolver">The resolver to use during deserialization. Use <c>null</c> to use the <see cref="DefaultResolver"/>.</param>
public void Serialize<T>(Stream stream, T value, IFormatterResolver resolver = null)
{
- using (var sequence = new Sequence<byte>())
+ using (var sequence = new Sequence<byte>(MemoryPoolWithMinSize.Instance))
{
this.Serialize<T>(sequence, value, resolver);
foreach (var segment in sequence.AsReadOnlySequence)