diff --git a/NuGetPackageVerifier.json b/NuGetPackageVerifier.json
index b153ab15..8e89b63f 100644
--- a/NuGetPackageVerifier.json
+++ b/NuGetPackageVerifier.json
@@ -1,7 +1,14 @@
{
- "Default": {
- "rules": [
- "DefaultCompositeRule"
- ]
+ "nonshipping": {
+ "rules": [],
+ "packages": {
+ "Microsoft.Extensions.Buffers.MemoryPool.Sources": {},
+ "Microsoft.Extensions.Buffers.Testing.Sources": {}
}
-}
\ No newline at end of file
+ },
+ "Default": {
+ "rules": [
+ "DefaultCompositeRule"
+ ]
+ }
+}
diff --git a/build/dependencies.props b/build/dependencies.props
index 7cde60bf..d3ae9f2d 100644
--- a/build/dependencies.props
+++ b/build/dependencies.props
@@ -19,9 +19,6 @@
2.2.0-preview1-34755
2.2.0-preview1-34755
2.2.0-preview1-34755
- 2.2.0-preview1-34755
- 2.2.0-preview1-34755
- 2.2.0-preview1-34755
2.2.0-preview1-34755
2.2.0-preview1-34755
2.2.0-preview1-34755
diff --git a/shared/Microsoft.Extensions.Buffers.MemoryPool.Sources/DiagnosticMemoryPool.cs b/shared/Microsoft.Extensions.Buffers.MemoryPool.Sources/DiagnosticMemoryPool.cs
new file mode 100644
index 00000000..3d2c0d72
--- /dev/null
+++ b/shared/Microsoft.Extensions.Buffers.MemoryPool.Sources/DiagnosticMemoryPool.cs
@@ -0,0 +1,165 @@
+// Copyright (c) Microsoft. All rights reserved.
+// Licensed under the MIT license. See LICENSE file in the project root for full license information.
+
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace System.Buffers
+{
+ ///
+ /// Used to allocate and distribute re-usable blocks of memory.
+ ///
+ internal class DiagnosticMemoryPool : MemoryPool
+ {
+ private readonly MemoryPool _pool;
+
+ private readonly bool _allowLateReturn;
+
+ private readonly bool _rentTracking;
+
+ private readonly object _syncObj;
+
+ private readonly HashSet _blocks;
+
+ private readonly List _blockAccessExceptions;
+
+ private readonly TaskCompletionSource