2020-05-16 05:10:31 UTC
the max stack depth in CLISP. Per the FAQ
"If you really do need more Lisp stack, you can increase it by
telling CLISP to pre-allocate more memory using -m or
My test script is this:
(defun st (n)
(if (= n 0)
(1+ (st (1- n)))))
(print (st 10000))
Yes, this counts up to n stupidly on purpose. It is a test script,
after all ;-).
ulimit -s 200000
clisp -m 100M test.lisp
but running (st 10000) gets the error
*** - Lisp stack overflow. RESET
and the same thing happens with other combinations of limits.
Note that the "ulimit -s unlimited" causes clisp to print on startup:
Warning: reserving address range 0x80000c0000...0x1fffffffffff that
contains memory mappings. clisp might crash later!
followed by a bunch of address ranges, but then the interpreter starts
Note: I'm aware of concepts like tail recursion, CL preferring iteration
and LOOP to recursion, and all that, and am not asking about those.
This is purely an implementation question about how to configure CLISP's
stack size. Any help with that would be appreciated. Thanks!