diff options
author | William Wilgus <me.theuser@yahoo.com> | 2019-07-12 05:23:52 -0500 |
---|---|---|
committer | William Wilgus <me.theuser@yahoo.com> | 2019-07-28 15:17:48 +0200 |
commit | 45bd14b392622cb58e967a24e4652c510b3d43e4 (patch) | |
tree | 22bd2e5cafc2d82ecc4773f83de7f86515b4db43 /apps/plugins/lua/lua_user.h | |
parent | 4beafe16fafc2e5c59734ef065a6f8d23766520d (diff) | |
download | rockbox-45bd14b392622cb58e967a24e4652c510b3d43e4.tar.gz rockbox-45bd14b392622cb58e967a24e4652c510b3d43e4.zip |
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
Diffstat (limited to 'apps/plugins/lua/lua_user.h')
-rw-r--r-- | apps/plugins/lua/lua_user.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/apps/plugins/lua/lua_user.h b/apps/plugins/lua/lua_user.h new file mode 100644 index 0000000000..f18f5e9d14 --- /dev/null +++ b/apps/plugins/lua/lua_user.h | |||
@@ -0,0 +1,14 @@ | |||
1 | #ifndef _LUA_USER_H_ | ||
2 | #define _LUA_USER_H_ | ||
3 | |||
4 | #define LUA_OOM(L) set_lua_OOM(L) | ||
5 | |||
6 | struct lua_OOM { | ||
7 | lua_State * L; | ||
8 | int count; | ||
9 | }; | ||
10 | |||
11 | int set_lua_OOM(lua_State * L); | ||
12 | |||
13 | struct lua_OOM* get_lua_OOM(void); | ||
14 | #endif | ||