More robust stack expansion and contraction
authorAndy Wingo <wingo@pobox.com>
Wed, 19 Feb 2014 10:01:39 +0000 (11:01 +0100)
committerAndy Wingo <wingo@pobox.com>
Wed, 19 Feb 2014 10:11:24 +0000 (11:11 +0100)
commitb8321c24aaeb6c9f4fef3063a8f87c4dd2173f4a
tree780b95984408bea66cd77614e3ad01b05ed22a1a
parent82490a665cfcf1053c2e14712679f114fb9c4477
More robust stack expansion and contraction

* libguile/vm.c (allocate_stack, expand_stack): Return NULL on
  allocation failure instead of throwing an exception.  Throwing an
  exception is tricky to get right, and we need more context to do it
  correctly.
  (return_unused_stack_to_os): Try again if madvise returns -EAGAIN.  If
  madvise fails, print an error message.
  (vm_expand_stack): Abort if stack expansion fails.  We'll fix this in
  a future patch.
  (make_vm): Abort if we can't mmap a single page.
libguile/vm.c