Remove default soft stack limit; add call-with-stack-overflow-handler
authorAndy Wingo <wingo@pobox.com>
Wed, 12 Mar 2014 16:18:13 +0000 (17:18 +0100)
committerAndy Wingo <wingo@pobox.com>
Wed, 12 Mar 2014 16:18:13 +0000 (17:18 +0100)
commitf764e2590fa1dbcafc5f188e1acc085e6fc6337b
treee65c0bf4373cb740f5c778a00790733684447467
parent3c3de73d4da32d2ae6371134a26449302524b8e0
Remove default soft stack limit; add call-with-stack-overflow-handler

* libguile/vm.h:
* libguile/vm.c (default_max_stack_size, initialize_default_stack_size):
  Remove the default stack limit.  In this way, programs run from the
  command line or outside of the REPL will have no soft stack limit.
  (make_vm): Change `max_stack_size' field to be a stack of limits and
  handlers.
  (current_overflow_size, should_handle_stack_overflow)
  (reset_stack_limit, wind_overflow_handler, unwind_overflow_handler)
  (vm_expand_stack): If the stack surpasses a user-set limit, call the
  user-specified handler within its outer stack limit.
  (call-with-stack-overflow-handler): New interface.

* module/system/vm/vm.scm: Export call-with-stack-overflow-handler.
libguile/vm.c
libguile/vm.h
module/system/vm/vm.scm