Skip to content
  • Andy Wingo's avatar
    Optimize make-stack · 3b14dd2f
    Andy Wingo authored
    * 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.
    3b14dd2f