mirror of
https://github.com/nodemcu/nodemcu-firmware.git
synced 2025-01-16 20:52:57 +08:00
085f35da73
Added `node.egc.meminfo()` to expose LVM usage (to make the regular `node.egc.ON_MEM_LIMIT` option usable). Extended the `node.egc.ON_MEM_LIMIT` option to also take negative limits, in which case that's taken as a request to keep a certain amount of heap available for non-Lua use.
14 lines
248 B
C
14 lines
248 B
C
// Lua EGC (Emergeny Garbage Collector) interface
|
|
|
|
#include "legc.h"
|
|
#include "lstate.h"
|
|
#include "c_types.h"
|
|
|
|
void legc_set_mode(lua_State *L, int mode, int limit) {
|
|
global_State *g = G(L);
|
|
|
|
g->egcmode = mode;
|
|
g->memlimit = limit;
|
|
}
|
|
|