|
|
|
@ -68,6 +68,7 @@ public static class TempAllocator |
|
|
|
|
|
|
|
|
|
public ResetOnDispose(ArenaAllocator allocator, int start) |
|
|
|
|
{ _allocator = allocator; _start = start; } |
|
|
|
|
|
|
|
|
|
// TODO: Print warning in finalizer if Dispose wasn't called manually. |
|
|
|
|
|
|
|
|
|
// IAllocator implementation |
|
|
|
@ -90,7 +91,7 @@ public class GlobalHeapAllocator |
|
|
|
|
=> Marshal.FreeHGlobal(pointer); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public sealed class ArenaAllocator |
|
|
|
|
public class ArenaAllocator |
|
|
|
|
: IAllocator |
|
|
|
|
, IDisposable |
|
|
|
|
{ |
|
|
|
@ -133,7 +134,7 @@ public sealed class ArenaAllocator |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public sealed class RingAllocator |
|
|
|
|
public class RingAllocator |
|
|
|
|
: IAllocator |
|
|
|
|
, IDisposable |
|
|
|
|
{ |
|
|
|
@ -166,5 +167,5 @@ public sealed class RingAllocator |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void Free(nint pointer) |
|
|
|
|
{ /* IGNORE */ } |
|
|
|
|
{ /* Do nothing. */ } |
|
|
|
|
} |
|
|
|
|