Hi Neil,
"Neil Jerram" <[EMAIL PROTECTED]> writes:
> - it uses a much larger amount of executed code to calibrate stack
> usage: specifically, all the code involved in starting up a standard
> debug-mode REPL
>
> - it focusses on the problem of getting `make check' to pass (when it
> should do so)
>
> - it does not modify the value or meaning of the default, C-coded stack limit
>
> - it doesn't require building the whole of Guile twice!
Great!
> I'm only looking at this stage for general thoughts; if you think this
> approach looks good, I will still need to
The approach looks good to me. It's just annoying that
`SCM_CHECK_STACK' (adding a slight overhead) and "threads.h" have to be
modified.
Instead of storing the high water mark in threads, could we have
`%get-stack-depth' and call it from somewhere deep in the code (similar
to what was in your previous patch)?
In that case, instead of using a void port for the REPL's output, we
could for instance use a soft port and measure the stack depth from
there:
(let ((before (%get-stack-depth))
(after #f)
(port (make-soft-port (vector (lambda (chr)
(set! after (%get-stack-depth)))
(lambda (str)
(set! after (%get-stack-depth)))
(lambda ()
(set! after (%get-stack-depth)))
#f #f #f))))
(with-output-to-port port
(lambda ()
(with-input-from-string "\n" top-repl)))
(abs (- after before)))
> BUILT_SOURCES = cpp_err_symbols.c cpp_sig_symbols.c libpath.h \
> version.h scmconfig.h \
> - $(DOT_X_FILES) $(EXTRA_DOT_X_FILES)
> + $(DOT_X_FILES) $(EXTRA_DOT_X_FILES) stack-limit-calibration.scm
As Greg suggested, this could be in `check_DATA' or something like that.
> +;; This is the value of top-repl-hwm-measured that we get on a
> +;; `canonical' build platform. (See text below for what that means.)
> +(define top-repl-hwm-i386-gnu-linux 9184)
I'd tend to use the actual GNU triplet, like `i386-pc-linux-gnu'.
Thanks for working on it!
Ludo'.