-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove the old implementations and add posix/win32 allocator
- Loading branch information
Showing
19 changed files
with
365 additions
and
579 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
50 changes: 0 additions & 50 deletions
50
src/Titan.Memory/Allocators/Win32VirtualAllocFixedSizeAllocator.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
using Titan.Core.Logging; | ||
//using Titan.Core.Logging; | ||
|
||
namespace Titan.Memory.Arenas; | ||
//namespace Titan.Memory.Arenas; | ||
|
||
public unsafe struct BestFitFixedArena | ||
{ | ||
public PlatformAllocator _allocator; | ||
public uint _maxSize; | ||
//public unsafe struct BestFitFixedArena | ||
//{ | ||
// public PlatformAllocator _allocator; | ||
// public uint _maxSize; | ||
|
||
public static bool Create(uint minBlockSize, uint maxSizeInBytes, out BestFitFixedArena arena) | ||
{ | ||
Logger.Warning<BestFitFixedArena>($"The {nameof(BestFitFixedArena)} has not been implemented yet, it uses VirtualAlloc/NativeLibrary."); | ||
// public static bool Create(uint minBlockSize, uint maxSizeInBytes, out BestFitFixedArena arena) | ||
// { | ||
// Logger.Warning<BestFitFixedArena>($"The {nameof(BestFitFixedArena)} has not been implemented yet, it uses VirtualAlloc/NativeLibrary."); | ||
|
||
arena = new BestFitFixedArena | ||
{ | ||
_allocator = PlatformAllocator.Create(), | ||
_maxSize = maxSizeInBytes | ||
}; | ||
// arena = new BestFitFixedArena | ||
// { | ||
// _allocator = PlatformAllocator.Create(), | ||
// _maxSize = maxSizeInBytes | ||
// }; | ||
|
||
return true; | ||
} | ||
// return true; | ||
// } | ||
|
||
public void* Allocate(nuint size, bool initialize = false) | ||
=> _allocator.Allocate(size, initialize); | ||
// public void* Allocate(nuint size, bool initialize = false) | ||
// => _allocator.Allocate(size, initialize); | ||
|
||
|
||
public void Free(void* ptr) | ||
=> _allocator.Free(ptr); | ||
// public void Free(void* ptr) | ||
// => _allocator.Free(ptr); | ||
|
||
public void Release() | ||
{ | ||
Logger.Warning<BestFitFixedArena>($"Not implemented yet"); | ||
} | ||
} | ||
// public void Release() | ||
// { | ||
// Logger.Warning<BestFitFixedArena>($"Not implemented yet"); | ||
// } | ||
//} |
Oops, something went wrong.