From 45bd14b392622cb58e967a24e4652c510b3d43e4 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Fri, 12 Jul 2019 05:23:52 -0500 Subject: Lua Add Emergency Garbage Collector Derivative of work by RobertGabrielJakabosky http://lua-users.org/wiki/EmergencyGarbageCollector I've only implemented the not enough memory part and expanded this idea to adding a mechanism to signal the OOM condition of the plugin buffer which allows us to only grab the playback buffer after garbage collection fails (SO THE MUSIC KEEPS PLAYING AS LONG AS POSSIBLE) Change-Id: I684fb98b540ffc01f7ba324ab5b761ceb59b9f9b --- apps/plugins/lua/lua_user.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 apps/plugins/lua/lua_user.h (limited to 'apps/plugins/lua/lua_user.h') diff --git a/apps/plugins/lua/lua_user.h b/apps/plugins/lua/lua_user.h new file mode 100644 index 0000000..f18f5e9 --- /dev/null +++ b/apps/plugins/lua/lua_user.h @@ -0,0 +1,14 @@ +#ifndef _LUA_USER_H_ +#define _LUA_USER_H_ + +#define LUA_OOM(L) set_lua_OOM(L) + +struct lua_OOM { + lua_State * L; + int count; +}; + +int set_lua_OOM(lua_State * L); + +struct lua_OOM* get_lua_OOM(void); +#endif -- cgit v1.1