Sha256: 788ab44308b808734ee6e405942de24f8548721caea758326977e34f02919cf1

Contents?: true

Size: 1.07 KB

Versions: 30

Compression:

Stored size: 1.07 KB

Contents

#include <vm_core.h>
#include <version.h>

#define ruby_current_thread ((rb_thread_t *)RTYPEDDATA_DATA(rb_thread_current()))

#if RUBY_API_VERSION_CODE >= 20500
  #if (RUBY_RELEASE_YEAR == 2017 && RUBY_RELEASE_MONTH == 10 && RUBY_RELEASE_DAY == 10) //workaround for 2.5.0-preview1
    #define TH_CFP(thread) ((rb_control_frame_t *)(thread)->ec.cfp)
    #define TH_INFO(thread) ((rb_thread_t *)thread)
  #else
    #define TH_CFP(thread) ((rb_control_frame_t *)(thread)->ec->cfp)
    #define TH_INFO(thread) ((rb_execution_context_t *)(thread)->ec)
  #endif
#else
  #define TH_CFP(thread) ((rb_control_frame_t *)(thread)->cfp)
  #define TH_INFO(thread) ((rb_thread_t *)thread)
#endif

extern void
update_stack_size(debug_context_t *context) 
{
  rb_thread_t *thread;

  thread = ruby_current_thread;
  /* see backtrace_each in vm_backtrace.c */
  context->stack_size = (int)(RUBY_VM_END_CONTROL_FRAME(TH_INFO(thread)) - TH_CFP(thread) - 1);
  if (CTX_FL_TEST(context, CTX_FL_UPDATE_STACK)) {
    context->calced_stack_size = context->stack_size;
    CTX_FL_UNSET(context, CTX_FL_UPDATE_STACK);
  }
}

Version data entries

30 entries across 19 versions & 3 rubygems

Version Path
tdiary-5.1.3 vendor/bundle/ruby/2.7.0/gems/debase-0.2.4.1/ext/hacks.h
debase-0.2.5.beta1 ext/hacks.h
debase-0.2.4.1 ext/hacks.h
debase-0.2.4 ext/hacks.h
debase-0.2.3 ext/hacks.h
debase-0.2.3.beta5 ext/hacks.h
debase-0.2.3.beta4 ext/hacks.h
debase-0.2.3.beta3 ext/hacks.h
debase-0.2.3.beta2 ext/hacks.h
debase-0.2.2 ext/hacks.h