Back to a stackless implementation

A "with stack" implementation gains too little in performance to be
worth all the noise from C-stack overflows.

This commit is almost a sketch, to test performance. There are several
pending stuff:

- review control of C-stack overflow and error messages;
- what to do with setcstacklimit;
- review comments;
- review unroll of Lua calls.
This commit is contained in:
Roberto Ierusalimschy
2020-09-21 10:31:03 -03:00
parent f83de8e34e
commit 5d8ce05b3f
11 changed files with 72 additions and 95 deletions

View File

@@ -36,8 +36,8 @@
** =====================================================================
*/
/*
@@ LUAI_MAXCSTACK defines the maximum depth for nested calls and
/* >>> move back to llimits.h
@@ LUAI_MAXCCALLS defines the maximum depth for nested calls and
** also limits the maximum depth of other recursive algorithms in
** the implementation, such as syntactic analysis. A value too
** large may allow the interpreter to crash (C-stack overflow).
@@ -46,8 +46,8 @@
** The test file 'cstack.lua' may help finding a good limit.
** (It will crash with a limit too high.)
*/
#if !defined(LUAI_MAXCSTACK)
#define LUAI_MAXCSTACK 2000
#if !defined(LUAI_MAXCCALLS)
#define LUAI_MAXCCALLS 200
#endif