diff options
Diffstat (limited to 'src/lua/lua_mempool.c')
-rw-r--r-- | src/lua/lua_mempool.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/lua/lua_mempool.c b/src/lua/lua_mempool.c index 62d294111..06dcd2d5c 100644 --- a/src/lua/lua_mempool.c +++ b/src/lua/lua_mempool.c @@ -582,17 +582,7 @@ lua_load_mempool (lua_State * L) void luaopen_mempool (lua_State * L) { - luaL_newmetatable (L, "rspamd{mempool}"); - lua_pushstring (L, "__index"); - lua_pushvalue (L, -2); - lua_settable (L, -3); - - lua_pushstring (L, "class"); - lua_pushstring (L, "rspamd{mempool}"); - lua_rawset (L, -3); - - luaL_register (L, NULL, mempoollib_m); + rspamd_lua_new_class (L, "rspamd{mempool}", mempoollib_m); + lua_pop (L, 1); rspamd_lua_add_preload (L, "rspamd_mempool", lua_load_mempool); - - lua_pop (L, 1); /* remove metatable from stack */ } |