Skip to content

Commit

Permalink
Extend the memory main pool to that of a 64-bit system
Browse files Browse the repository at this point in the history
  • Loading branch information
aboood40091 committed Aug 13, 2020
1 parent 07359de commit 6ae4f46
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion include/platform_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#define IS_BIG_ENDIAN (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
#endif

#define DOUBLE_SIZE_ON_64_BIT(size) ((size) * (sizeof(void *) / 4))
// Using 8 here instead of sizeof(size_t) to ensure compatibility
#define SIZEOF_POINTER (size_t)8
#define DOUBLE_SIZE_ON_64_BIT(size) ((size) * (SIZEOF_POINTER / 4))

#endif // PLATFORM_INFO_H
4 changes: 2 additions & 2 deletions src/pc/pc_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ void main_func(void) {
WHBLogPrint("Exception handler initialized.");
#endif

static u64 pool[0x165000/8 / 4 * sizeof(void *)];
main_pool_init(pool, pool + sizeof(pool) / sizeof(pool[0]));
static u8 pool[DOUBLE_SIZE_ON_64_BIT(0x165000)] __attribute__ ((aligned(16)));
main_pool_init(pool, pool + sizeof(pool));
gEffectsMemoryPool = mem_pool_init(0x4000, MEMORY_POOL_LEFT);

configfile_load(CONFIG_FILE);
Expand Down

0 comments on commit 6ae4f46

Please sign in to comment.