Skip to content

Commit

Permalink
Tweak memory allocation size for portability
Browse files Browse the repository at this point in the history
Close #161
  • Loading branch information
ChinYikMing committed Sep 17, 2023
1 parent d8d4bd1 commit b6d6ec7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,15 @@
#include "io.h"

static uint8_t *data_memory_base;
/* set memory size to 2^32 bytes */
#define MEM_SIZE 0x100000000ULL
/* set memory size to 2^32 - 1 bytes
*
* In order to make rv32emu portable for both 32-bit and 64-bit systems,
* we need keep the memory size to a maximum of 2^32 - 1 bytes,
* this allows rv32emu to access every segment of memory in either environment.
* Furthermore, it is safe since most test cases' data memory usage
* will not exceed 0xFFFFFFFF for now.
*/
#define MEM_SIZE 0xFFFFFFFFULL

memory_t *memory_new()
{
Expand Down

0 comments on commit b6d6ec7

Please # to comment.