Added Vmem allocator

This commit is contained in:
Christoffer Lerno
2025-07-13 17:26:57 +02:00
parent e755c36ea2
commit aba9baf207
5 changed files with 322 additions and 4 deletions

View File

@@ -286,7 +286,7 @@ macro compare_exchange_volatile(ptr, compare, value, AtomicOrdering $success = S
*>
fn usz aligned_offset(usz offset, usz alignment)
{
return alignment * ((offset + alignment - 1) / alignment);
return (offset + alignment - 1) & ~(alignment - 1);
}
macro void* aligned_pointer(void* ptr, usz alignment)