diff options
author | Andy Wingo <wingo@pobox.com> | 2014-01-31 21:41:36 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2014-01-31 21:41:36 +0100 |
commit | 7dba1c2ff139be60ccf7f81debd4bb85a07ab8f6 (patch) | |
tree | 50f49922d6bb7f049e928262c7cae4348097c258 /libguile/vm.h | |
parent | 7161ec1133d33a4c06261dd6a621026c3d4d1ef5 (diff) | |
download | guile-7dba1c2ff139be60ccf7f81debd4bb85a07ab8f6.tar.gz |
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.
Diffstat (limited to 'libguile/vm.h')
-rw-r--r-- | libguile/vm.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libguile/vm.h b/libguile/vm.h index 6a257328e..9edced12d 100644 --- a/libguile/vm.h +++ b/libguile/vm.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2001, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. +/* Copyright (C) 2001, 2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -39,10 +39,11 @@ struct scm_vm { scm_t_uint32 *ip; /* instruction pointer */ SCM *sp; /* stack pointer */ SCM *fp; /* frame pointer */ - size_t stack_size; /* stack size */ - SCM *stack_base; /* stack base address */ SCM *stack_limit; /* stack limit address */ int trace_level; /* traces enabled if trace_level > 0 */ + SCM *sp_max_since_gc; /* highest sp since last gc */ + size_t stack_size; /* stack size */ + SCM *stack_base; /* stack base address */ size_t max_stack_size; SCM hooks[SCM_VM_NUM_HOOKS]; /* hooks */ int engine; /* which vm engine we're using */ |