Skip to content

Commit d03370f

Browse files
committed
alloc more mem
1 parent ec3b2b1 commit d03370f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

test/nops

0 Bytes
Binary file not shown.

test/test.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ static void dump_benchmark(struct rvm *ctx, tstamp elapsed)
3737
# endif
3838
#endif
3939

40+
#define MEMSZ (1<<26) /* 64MB */
41+
4042

4143
static void dump_state(struct rvm *ctx, signed stat)
4244
{
@@ -93,7 +95,7 @@ static char *load_file(const char *path, rvm_uint *memsz,
9395
rvm_uint sz = ftell(fp);
9496
fseek(fp, 0, SEEK_SET);
9597

96-
rvm_uint reqmem = rvm_calcfmem(sz);
98+
rvm_uint reqmem = rvm_calcfmem(MEMSZ);
9799

98100
char *mem = (char*)malloc(reqmem);
99101
if (!mem) {
@@ -149,6 +151,7 @@ int main(int argc, char **argv)
149151
return 1;
150152
struct rvm ctx = rvm_new(mem, memsz);
151153
ctx.pc = 0;
154+
ctx.reg[RVM_RSP] = ctx.memsz;
152155

153156
#if defined(BENCH_)
154157
tstamp start = get_tstamp();

0 commit comments

Comments
 (0)