mirror of
https://github.com/pound-emu/pound.git
synced 2025-12-13 13:37:02 +00:00
memory: updated arena_init() docs
arena_init() has been given the parameter `size_t capacity`, however, docs amd some definitions wasn't changed to reflect this. The definition MEMORY_CAPACITY was replaced by `size_t capacity` but it wasn't removed. Signed-off-by: Ronald Caesar <github43132@proton.me>
This commit is contained in:
parent
84c55b25a9
commit
b41e8b9d4f
2 changed files with 14 additions and 17 deletions
|
|
@ -9,7 +9,7 @@ memory::arena_t memory::arena_init(size_t capacity)
|
|||
|
||||
// TODO(GloriousTaco:memory): Replace malloc with a windows memory mapping API.
|
||||
#ifdef WIN32
|
||||
auto data = static_cast<uint8_t*>(malloc(sizeof(uint8_t) * MEMORY_CAPACITY));
|
||||
auto data = static_cast<uint8_t*>(malloc(sizeof(size_t) * capacity));
|
||||
#else
|
||||
void* data = ::mmap(nullptr, capacity, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
|
||||
if (data == MAP_FAILED)
|
||||
|
|
@ -41,7 +41,7 @@ void memory::arena_reset(memory::arena_t* arena)
|
|||
ASSERT(nullptr != arena);
|
||||
ASSERT(nullptr != arena->data);
|
||||
arena->size = 0;
|
||||
std::memset(arena->data, POISON_PATTERN, arena->capacity);
|
||||
(void)std::memset(arena->data, POISON_PATTERN, arena->capacity);
|
||||
}
|
||||
void memory::arena_free(memory::arena_t* arena)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue