diff options
Diffstat (limited to 'lib/Net.Http/src')
-rw-r--r-- | lib/Net.Http/src/Core/ConnectionInfo.cs (renamed from lib/Net.Http/src/ConnectionInfo.cs) | 0 | ||||
-rw-r--r-- | lib/Net.Http/src/Core/Request/HttpRequest.cs | 5 | ||||
-rw-r--r-- | lib/Net.Http/src/Helpers/CoreBufferHelpers.cs | 14 |
3 files changed, 11 insertions, 8 deletions
diff --git a/lib/Net.Http/src/ConnectionInfo.cs b/lib/Net.Http/src/Core/ConnectionInfo.cs index 6e1660d..6e1660d 100644 --- a/lib/Net.Http/src/ConnectionInfo.cs +++ b/lib/Net.Http/src/Core/ConnectionInfo.cs diff --git a/lib/Net.Http/src/Core/Request/HttpRequest.cs b/lib/Net.Http/src/Core/Request/HttpRequest.cs index 593275d..356c3f6 100644 --- a/lib/Net.Http/src/Core/Request/HttpRequest.cs +++ b/lib/Net.Http/src/Core/Request/HttpRequest.cs @@ -137,9 +137,12 @@ namespace VNLib.Net.Http.Core public string Compile() { //Alloc char buffer for compilation - using UnsafeMemoryHandle<char> buffer = Memory.UnsafeAlloc<char>(16 * 1024, true); + using UnsafeMemoryHandle<char> buffer = MemoryUtil.UnsafeAlloc<char>(16 * 1024, true); + ForwardOnlyWriter<char> writer = new(buffer.Span); + Compile(ref writer); + return writer.ToString(); } diff --git a/lib/Net.Http/src/Helpers/CoreBufferHelpers.cs b/lib/Net.Http/src/Helpers/CoreBufferHelpers.cs index 5cc5ed9..15c617c 100644 --- a/lib/Net.Http/src/Helpers/CoreBufferHelpers.cs +++ b/lib/Net.Http/src/Helpers/CoreBufferHelpers.cs @@ -104,7 +104,7 @@ namespace VNLib.Net.Http.Core /// </summary> public static IUnmangedHeap HttpPrivateHeap => _lazyHeap.Value; - private static readonly Lazy<IUnmangedHeap> _lazyHeap = new(Memory.InitializeNewHeapForProcess, LazyThreadSafetyMode.PublicationOnly); + private static readonly Lazy<IUnmangedHeap> _lazyHeap = new(MemoryUtil.InitializeNewHeapForProcess, LazyThreadSafetyMode.PublicationOnly); /// <summary> /// Alloctes an unsafe block of memory from the internal heap, or buffer pool @@ -120,11 +120,11 @@ namespace VNLib.Net.Http.Core size = (size / 4096 + 1) * 4096; //If rpmalloc lib is loaded, use it - if (Memory.IsRpMallocLoaded) + if (MemoryUtil.IsRpMallocLoaded) { - return Memory.Shared.UnsafeAlloc<byte>(size, zero); + return MemoryUtil.Shared.UnsafeAlloc<byte>(size, zero); } - else if (size > Memory.MAX_UNSAFE_POOL_SIZE) + else if (size > MemoryUtil.MAX_UNSAFE_POOL_SIZE) { return HttpPrivateHeap.UnsafeAlloc<byte>(size, zero); } @@ -140,12 +140,12 @@ namespace VNLib.Net.Http.Core size = (size / 4096 + 1) * 4096; //If rpmalloc lib is loaded, use it - if (Memory.IsRpMallocLoaded) + if (MemoryUtil.IsRpMallocLoaded) { - return Memory.Shared.DirectAlloc<byte>(size, zero); + return MemoryUtil.Shared.DirectAlloc<byte>(size, zero); } //Avoid locking in heap unless the buffer is too large to alloc array - else if (size > Memory.MAX_UNSAFE_POOL_SIZE) + else if (size > MemoryUtil.MAX_UNSAFE_POOL_SIZE) { return HttpPrivateHeap.DirectAlloc<byte>(size, zero); } |