summaryrefslogtreecommitdiff
path: root/libguile/frames.h
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2014-04-14 16:31:02 +0200
committerAndy Wingo <wingo@pobox.com>2014-04-14 16:31:02 +0200
commit3b14dd2f272920854565011d82b41df1237a2213 (patch)
treee336aaa9e7865db533ac003a8193c377b9aa6436 /libguile/frames.h
parent8de051da47e8f0f56a13bde6a4b37ece5f9c81cf (diff)
downloadguile-3b14dd2f272920854565011d82b41df1237a2213.tar.gz
Optimize make-stack
* libguile/continuations.h: * libguile/continuations.c (scm_i_continuation_to_frame): Operate on low-level C structures instead of heap objects. * libguile/frames.h: * libguile/frames.c (frame_offset, frame_stack_base): Const args. (scm_c_frame_closure): New helper. (scm_frame_procedure): Use the new helper. * libguile/stacks.c (stack_depth, narrow_stack, scm_make_stack): Rework to avoid allocating frames as we traverse the stack, and to avoid an n**2 case where there are outer cuts.
Diffstat (limited to 'libguile/frames.h')
-rw-r--r--libguile/frames.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/libguile/frames.h b/libguile/frames.h
index e4a75458b..6defff5fd 100644
--- a/libguile/frames.h
+++ b/libguile/frames.h
@@ -167,6 +167,10 @@ enum scm_vm_frame_kind
SCM_INTERNAL SCM* scm_i_frame_stack_base (SCM frame);
SCM_INTERNAL scm_t_ptrdiff scm_i_frame_offset (SCM frame);
+/* See notes in frames.c before using this. */
+SCM_INTERNAL SCM scm_c_frame_closure (enum scm_vm_frame_kind kind,
+ const struct scm_frame *frame);
+
SCM_INTERNAL SCM scm_c_make_frame (enum scm_vm_frame_kind kind,
const struct scm_frame *frame);