1
0
Fork 0
forked from len0rd/rockbox
foxbox/apps/plugins/lua
William Wilgus a332924f68 lua late bound cfunction tables
We have quite a bit of ram tied up in lua with our c libraries
I was searching for a way to free up some of this when I came
across read only tables in e-lua but that involved a lot of patching
through the source

Instead I came up with this..
it frees about 15k ram without much slowdown in code execution
since after a function gets called it is automatically added to the table

If you have a performance issue you can call the bind method
to bind a specific function or the whole table in one shot

for instance rb table
rb("lcd_clear") -- binds/returns function rb.lcd_clear()
rb(nil) -- binds every function in rb table + removes latebind metatable ..

-- added pairs and ipairs code from lua 5.2
-- cleaned up code + made more seamless
  existing fields are now saved rather than overwritten when table is bound

Change-Id: I1c20e76b736c032dedc727d2e58928641e40191d
2019-07-11 00:09:54 -05:00
..
include_lua lua add LCD_DEFAULT_FG, fix 2-bit screen fg/bg inversion 2018-11-24 16:40:23 -05:00
action_helper.pl Lua: Add pluginlib_actions wrapper for lua scripts. 2012-01-27 09:15:05 +01:00
button_helper.pl Lua: always expose BUTTON_TOUCHSCREEN and remove BUTTON_ constants from rocklib.c 2009-07-03 23:03:07 +00:00
lapi.c Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
lapi.h Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
lauxlib.c lua late bound cfunction tables 2019-07-11 00:09:54 -05:00
lauxlib.h lua update to 5.1.5 2018-11-11 19:42:30 -05:00
lbaselib.c lua update to 5.1.5 2018-11-11 19:42:30 -05:00
lbitlib.c Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
lcode.c lua update to 5.1.5 2018-11-11 19:42:30 -05:00
lcode.h Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
ldebug.c Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
ldebug.h Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
ldo.c lua update to 5.1.5 2018-11-11 19:42:30 -05:00
ldo.h Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
ldump.c Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
lfunc.c Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
lfunc.h Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
lgc.c lua inbinary strings 2019-07-11 00:31:41 +02:00
lgc.h Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
liolib.c lua update to 5.1.5 2018-11-11 19:42:30 -05:00
llex.c lua inbinary strings 2019-07-11 00:31:41 +02:00
llex.h Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
llimits.h Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
lmathlib.c lua update to 5.1.5 2018-11-11 19:42:30 -05:00
lmem.c Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
lmem.h Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
loadlib.c lua update to 5.1.5 2018-11-11 19:42:30 -05:00
lobject.c lua inbinary strings 2019-07-11 00:31:41 +02:00
lobject.h lua inbinary strings 2019-07-11 00:31:41 +02:00
lopcodes.c Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
lopcodes.h Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
loslib.c Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
lparser.c lua update to 5.1.5 2018-11-11 19:42:30 -05:00
lparser.h Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
lstate.c Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
lstate.h Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
lstring.c lua inbinary strings 2019-07-11 00:31:41 +02:00
lstring.h lua inbinary strings 2019-07-11 00:31:41 +02:00
lstrlib.c lua update to 5.1.5 2018-11-11 19:42:30 -05:00
ltable.c Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
ltable.h Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
ltablib.c Fix misleading indentation as pointed out by the new gcc warning 2016-08-12 15:33:28 +02:00
ltm.c lua inbinary strings 2019-07-11 00:31:41 +02:00
ltm.h Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
lua.h lua update to 5.1.5 2018-11-11 19:42:30 -05:00
lua.make Fix lua helpers -- supress line markers in preproc source generation scripts 2018-12-24 21:37:06 +01:00
luaconf.h lua remove error messages for pre-compiled chunks 2019-07-09 01:03:58 +02:00
luadir.c Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
luadir.h FS#11347 by me: *dir LUA functions: luadir module 2010-06-18 13:10:14 +00:00
lualib.h Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
lundump.c lua remove error messages for pre-compiled chunks 2019-07-09 01:03:58 +02:00
lundump.h Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
lvm.c lua update to 5.1.5 2018-11-11 19:42:30 -05:00
lvm.h Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
lzio.c Lua fix reader bug in lzio 2018-11-15 11:20:54 +01:00
lzio.h Revert "Update lua plugin to 5.2.3" 2014-04-02 20:46:06 +02:00
Makefile FS#12144, Use -fPIC -fvisibility=hidden only for plugins on sim and app builds and enable it for 32 bit too. Fixes linking errors on simbuilds. 2011-06-07 11:56:23 +00:00
README Lua remove strncat.c & strcspn.c 2018-10-30 04:17:06 +01:00
rockaux.c Lua replace fscanf 2018-10-29 23:22:35 -04:00
rockconf.h lua inbinary strings 2019-07-11 00:31:41 +02:00
rocklib.c lua inbinary strings 2019-07-11 00:31:41 +02:00
rocklib.h Lua fix crash on arm devices 2018-11-17 09:04:05 -05:00
rocklib_aux.pl Lua optimize combine and rework similar functions 2018-11-02 18:00:06 +01:00
rocklib_img.c lua fix rlimage FB_SCALARPACK() 2018-11-02 00:42:57 -04:00
rocklib_img.h lua move rocklib_img to its own separate loadable module 2018-10-22 14:00:58 -04:00
rocklibc.h lua update to 5.1.5 2018-11-11 19:42:30 -05:00
rocklua.c lua move rocklib_img to its own separate loadable module 2018-10-22 14:00:58 -04:00
settings_helper.pl Lua Fix settings_helper for the gigaBeastS 2018-12-17 09:41:15 -06:00
SOURCES Lua replace fscanf 2018-10-29 23:22:35 -04:00
strftime.c Lua update strftime.c from dietlibc source 2018-10-30 02:39:11 -04:00
strpbrk.c Initial commit of the Samsung YP-R0 port. 2011-12-24 11:56:46 +00:00
strstr.c
strtol.c
strtoul.c
tlsf_helper.c lua: Switch memory allocator from dl to tlsf 2013-08-26 09:42:47 +02:00

The following files are (with slight modifications for Rockbox) from dietlibc
version 0.31 which is licensed under the GPL version 2:

    gmtime.c
    strftime.c
    strpbrk.c
    strtol.c
    strtoul.c
    strstr.c