aboutsummaryrefslogtreecommitdiff
path: root/api_stash.c
diff options
context:
space:
mode:
Diffstat (limited to 'api_stash.c')
-rw-r--r--api_stash.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/api_stash.c b/api_stash.c
index cc95c4b..506acec 100644
--- a/api_stash.c
+++ b/api_stash.c
@@ -24,7 +24,7 @@ _lstash__gc(lua_State *L)
atom_ser_t *ser = &lstash->ser;
if(ser->buf)
- tlsf_free(ser->tlsf, ser->buf);
+ moony_free(ser->moony, ser->buf, ser->size);
return 0;
}
@@ -81,10 +81,10 @@ _lstash(lua_State *L)
// initialize memory pool
atom_ser_t *ser = &lstash->ser;
- ser->tlsf = moony->vm.tlsf;
+ ser->moony = moony;
ser->size = 1024;
ser->offset = 0; // reset stash pointer
- ser->buf = tlsf_malloc(moony->vm.tlsf, ser->size);
+ ser->buf = moony_alloc(moony, ser->size);
if(!ser->buf)
lua_pushnil(L); // memory allocation failed