Skip to content

Commit

Permalink
Fixed an issues with the size of the memory blocks of the arena when
Browse files Browse the repository at this point in the history
running with emscripten
  • Loading branch information
tanis2000 committed Oct 1, 2024
1 parent 5ff67e1 commit 8397d46
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/binocle/core/binocle_memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
//

#include "binocle_memory.h"

#include "binocle_log.h"
#include "binocle_math.h"
#include "binocle_sdl.h"
#include <assert.h>
Expand Down Expand Up @@ -78,8 +80,12 @@ binocle_memory_block *binocle_memory_allocate(binocle_memory_index size,
uint64_t flags) {
// We require memory block headers not to change the cache
// line alignment of an allocation
binocle_log_debug("binocle_memory_allocate: size of binocle_memory_platform_block: %d", sizeof(binocle_memory_platform_block));
#if defined(__EMSCRIPTEN__)
assert(sizeof(binocle_memory_platform_block) == 40);
#else
assert(sizeof(binocle_memory_platform_block) == 56);

#endif
uintptr_t page_size = 4096;
uintptr_t total_size = size + sizeof(binocle_memory_platform_block);
uintptr_t base_offset = sizeof(binocle_memory_platform_block);
Expand Down

0 comments on commit 8397d46

Please sign in to comment.