diff options
Diffstat (limited to 'lib/Utils')
-rw-r--r-- | lib/Utils/src/Extensions/MemoryExtensions.cs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/Utils/src/Extensions/MemoryExtensions.cs b/lib/Utils/src/Extensions/MemoryExtensions.cs index 17ad79d..237a567 100644 --- a/lib/Utils/src/Extensions/MemoryExtensions.cs +++ b/lib/Utils/src/Extensions/MemoryExtensions.cs @@ -1,5 +1,5 @@ /* -* Copyright (c) 2022 Vaughn Nugent +* Copyright (c) 2023 Vaughn Nugent * * Library: VNLib * Package: VNLib.Utils @@ -28,10 +28,11 @@ using System.Buffers; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; +using VNLib.Utils.Memory; +using VNLib.Utils.Resources; + namespace VNLib.Utils.Extensions { - using Utils.Memory; - using VNLib.Utils.Resources; /// <summary> /// Provides memory based extensions to .NET and VNLib memory abstractions @@ -52,7 +53,7 @@ namespace VNLib.Utils.Extensions //Pool buffer handles are considered "safe" so im reusing code for now return new(pool, size, zero); } - + /// <summary> /// Retreives a buffer that is at least the reqested length, and clears the array from 0-size. /// <br></br> @@ -70,7 +71,7 @@ namespace VNLib.Utils.Extensions //If zero flag is set, zero only the used section if (zero) { - Array.Fill(arr, default); + arr.AsSpan().Clear(); } return arr; } |