- Thu Apr 02, 2015 9:34 am
#13276
Moin,
change as follows:
app/lua/luaconf.h
@@ -542,8 +542,16 @@ extern int readline4lua(const char *prompt, char *buffer, int length);
/*
@@ LUAL_BUFFERSIZE is the buffer size used by the lauxlib buffer system.
*/
+/*#define LUAL_BUFFERSIZE ((BUFSIZ)*4) */
#define LUAL_BUFFERSIZE BUFSIZ
The increase was done in nodemcu patch to solve problems loading compiled lua programs > 1 K.
I didn't checked if reducing buffersize will re-introduce that bug. If so a simple fix
would be changing the single usage in the bytecode loading code to (4*(LUAL_BUFFERSIZE)).
I am willing to help if that problem arises. From my very short look at the bytecode loading code
I am not convinced that stack based memory is a good solution there.
I am trying to make my esp8266 with nodemcu more robust in case of short resources or at minimum provide
better error messages/stack traces before doing a reboot.
Maybe someone can give me a hint about the RAM memory model used when running nodemcu.
The typical setup is having a RAM block where C stack starts at one end e.g. lower end and heap memory (malloc etc.)
start at the other end.
Is that true with nodemcu, too.
I think this is the case and there is no protection or detection in place when both start to overlap other than
memory corruption and typically a reboot soon.
Any hints where to look for more infos?
Carsten
pracas wrote:@cal
I'm facing a similar issue with an attempted oled library and wondering if you can throw some light on how to do this? What / Where to edit the buffersize?
I built the same firmware using a smaller value for the buffersize (1024 bytes instead of 4096 bytes)
All help is appreciated.