Diff

util-src/ringbuffer.c @ 7969:1c6a07606309

util-src: Specify size of various tables to be allocated
author Kim Alvefur <zash@zash.se>
date Thu, 09 Mar 2017 01:20:59 +0100
parent 7941:8067828e7e40
child 8543:0e1d8f2f02bf
line wrap: on
line diff
--- a/util-src/ringbuffer.c	Thu Mar 09 00:59:32 2017 +0100
+++ b/util-src/ringbuffer.c	Thu Mar 09 01:20:59 2017 +0100
@@ -187,7 +187,7 @@
 		lua_pushcfunction(L, rb_length);
 		lua_setfield(L, -2, "__len");
 
-		lua_newtable(L); /* __index */
+		lua_createtable(L, 0, 7); /* __index */
 		{
 			lua_pushcfunction(L, rb_find);
 			lua_setfield(L, -2, "find");
@@ -207,7 +207,7 @@
 		lua_setfield(L, -2, "__index");
 	}
 
-	lua_newtable(L);
+	lua_createtable(L, 0, 1);
 	lua_pushcfunction(L, rb_new);
 	lua_setfield(L, -2, "new");
 	return 1;