feat(lowlevel): add VirtualStack, update allocators, docs
Introduce VirtualStack allocator, refactor memory management to use virtual memory stacks, and update documentation. Added VirtualStack as a new stack allocator using virtual memory, replaced Stack with VirtualStack in allocation manager and related APIs, and updated TempJobAllocator to use VirtualArena. Introduced AllocationManagerInitOpts for allocator configuration. Replaced ENABLE_COLLECTION_CHECKS with ENABLE_SAFETY_CHECKS for safety checks. Removed Result.cs and updated project files and examples. Added comprehensive README files for all major packages and improved root documentation. BREAKING CHANGE: Stack allocator replaced by VirtualStack; TempJobAllocator and AllocationManager initialization signatures changed; Result types removed.
This commit is contained in:
@@ -38,8 +38,7 @@ public unsafe struct MemoryPool<T, TOpts> : IDisposable
|
||||
return Allocate(pAllocator, newSize, alignment, allocationOption, pHandle);
|
||||
}
|
||||
|
||||
MemoryHandle newHandle;
|
||||
var newPtr = Allocate(pAllocator, newSize, alignment, allocationOption, &newHandle);
|
||||
var newPtr = Allocate(pAllocator, newSize, alignment, allocationOption, pHandle);
|
||||
if (newPtr == null)
|
||||
{
|
||||
return null;
|
||||
@@ -48,7 +47,6 @@ public unsafe struct MemoryPool<T, TOpts> : IDisposable
|
||||
MemCpy(newPtr, ptr, Math.Min(oldSize, newSize));
|
||||
Free(pAllocator, ptr, *pHandle);
|
||||
|
||||
*pHandle = newHandle;
|
||||
return newPtr;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user