aboutsummaryrefslogtreecommitdiff
path: root/lib/Plugins.Essentials/src/Extensions
diff options
context:
space:
mode:
authorLibravatar vnugent <public@vaughnnugent.com>2023-01-14 16:24:28 -0500
committerLibravatar vnugent <public@vaughnnugent.com>2023-01-14 16:24:28 -0500
commit52b8e30437e235817ed534dec860e781bb0468c0 (patch)
treeb279418c23daec838fab6bf8a0b29c3091d2e300 /lib/Plugins.Essentials/src/Extensions
parent0dcecff0f51bdb51b070c05255fbcd9338ab11f2 (diff)
MemoryUtil native integer size update + tests
Diffstat (limited to 'lib/Plugins.Essentials/src/Extensions')
-rw-r--r--lib/Plugins.Essentials/src/Extensions/JsonResponse.cs9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/Plugins.Essentials/src/Extensions/JsonResponse.cs b/lib/Plugins.Essentials/src/Extensions/JsonResponse.cs
index 22cccd9..d087c06 100644
--- a/lib/Plugins.Essentials/src/Extensions/JsonResponse.cs
+++ b/lib/Plugins.Essentials/src/Extensions/JsonResponse.cs
@@ -49,12 +49,19 @@ namespace VNLib.Plugins.Essentials.Extensions
internal JsonResponse(IObjectRental<JsonResponse> pool)
{
+ /*
+ * I am breaking the memoryhandle rules by referrencing the same
+ * memory handle in two different wrappers.
+ */
+
_pool = pool;
//Alloc buffer
- _handle = Memory.Shared.Alloc<byte>(4096, false);
+ _handle = MemoryUtil.Shared.Alloc<byte>(4096, false);
+
//Consume handle for stream, but make sure not to dispose the stream
_asStream = VnMemoryStream.ConsumeHandle(_handle, 0, false);
+
//Get memory owner from handle
_memoryOwner = _handle.ToMemoryManager(false);
}