#include "ruby/ruby.h" #include "ruby/debug.h" #define MAX_BUF_SIZE 0x100 static VALUE profile_frames(VALUE self, VALUE start_v, VALUE num_v) { int i, collected_size; int start = NUM2INT(start_v); int buff_size = NUM2INT(num_v); VALUE buff[MAX_BUF_SIZE]; int lines[MAX_BUF_SIZE]; VALUE result = rb_ary_new(); if (buff_size > MAX_BUF_SIZE) rb_raise(rb_eRuntimeError, "too long buff_size"); collected_size = rb_profile_frames(start, buff_size, buff, lines); for (i=0; i