Return unused parts of the stack to the OS
authorAndy Wingo <wingo@pobox.com>
Fri, 31 Jan 2014 20:41:36 +0000 (21:41 +0100)
committerAndy Wingo <wingo@pobox.com>
Fri, 31 Jan 2014 20:41:36 +0000 (21:41 +0100)
commit7dba1c2ff139be60ccf7f81debd4bb85a07ab8f6
tree50f49922d6bb7f049e928262c7cae4348097c258
parent7161ec1133d33a4c06261dd6a621026c3d4d1ef5
Return unused parts of the stack to the OS

* libguile/vm.h (struct scm_vm): Reorder fields.  Add "sp_max_since_gc"
  field.
* libguile/vm-engine.c (ALLOC_FRAME, RESET_FRAME):
* libguile/vm.c (vm_return_to_continuation)
  (vm_reinstate_partial_continuation, scm_call_n): In places where we
  could increase the stack height, update sp_max_since_gc.
  (vm_expand_stack): Relocate sp_max_since_gc on expansion.
  (scm_bootstrap_vm): Record the page size using gnulib's getpagesize.
  (return_unused_stack_to_os): New routine, run when marking stacks.
libguile/vm-engine.c
libguile/vm.c
libguile/vm.h