Optimize make-stack
authorAndy Wingo <wingo@pobox.com>
Mon, 14 Apr 2014 14:31:02 +0000 (16:31 +0200)
committerAndy Wingo <wingo@pobox.com>
Mon, 14 Apr 2014 14:31:02 +0000 (16:31 +0200)
commit3b14dd2f272920854565011d82b41df1237a2213
treee336aaa9e7865db533ac003a8193c377b9aa6436
parent8de051da47e8f0f56a13bde6a4b37ece5f9c81cf
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.
libguile/continuations.c
libguile/continuations.h
libguile/frames.c
libguile/frames.h
libguile/stacks.c