diff --git a/rewrite/luaarch.c b/rewrite/luaarch.c index 2071c8e..07d96a0 100644 --- a/rewrite/luaarch.c +++ b/rewrite/luaarch.c @@ -117,8 +117,7 @@ static void luaArch_nnToLua(luaArch *arch, lua_State *L, size_t nnIdx) { } static int luaArch_computer_freeMemory(lua_State *L) { - size_t freeMem = luaArch_from(L)->freeMem; - lua_pushinteger(L, freeMem); + lua_pushinteger(L, nn_getFreeMemory(luaArch_from(L)->computer)); return 1; } diff --git a/rewrite/main.c b/rewrite/main.c index ee6145d..07a8c99 100644 --- a/rewrite/main.c +++ b/rewrite/main.c @@ -1061,7 +1061,7 @@ int main(int argc, char **argv) { nn_ComponentState *gputype = nn_createGPU(u, &nn_defaultGPUs[3], ne_gpu_handler, NULL); size_t ramTotal = 0; - ramTotal += nn_ramSizes[0]; + ramTotal += nn_ramSizes[5]; nn_Computer *c = nn_createComputer(u, NULL, "computer0", ramTotal, 256, 256); if(showStats) {