74newobj_i(
VALUE tpval,
void *data)
91 if (
arg->keep_remains) {
97 delete_unique_str(
arg->str_table, info->
path);
107 info->
path = path_cstr;
116freeobj_i(
VALUE tpval,
void *data)
124 if (
arg->keep_remains) {
133 delete_unique_str(
arg->str_table, info->
path);
155static int tmp_keep_remains;
158get_traceobj_arg(
void)
160 if (tmp_trace_arg == 0) {
169 return tmp_trace_arg;
179trace_object_allocations_start(
VALUE self)
183 if (
arg->running++ > 0) {
187 if (
arg->newobj_trace == 0) {
210trace_object_allocations_stop(
VALUE self)
214 if (
arg->running > 0) {
218 if (
arg->running == 0) {
233trace_object_allocations_clear(
VALUE self)
277trace_object_allocations(
VALUE self)
279 trace_object_allocations_start(
self);
284static int object_allocations_reporter_registered = 0;
307object_allocations_reporter(
FILE *out,
void *
ptr)
309 fprintf(out,
"== object_allocations_reporter: START\n");
313 fprintf(out,
"== object_allocations_reporter: END\n");
317trace_object_allocations_debug_start(
VALUE self)
319 tmp_keep_remains = 1;
320 if (object_allocations_reporter_registered == 0) {
321 object_allocations_reporter_registered = 1;
325 return trace_object_allocations_start(
self);
343 return lookup_allocation_info(
obj);
358 if (info && info->
path) {
493 rb_define_module_function(rb_mObjSpace,
"trace_object_allocations_debug_start", trace_object_allocations_debug_start, 0);
VALUE rb_tracearg_object(rb_trace_arg_t *trace_arg)
VALUE rb_tracearg_defined_class(rb_trace_arg_t *trace_arg)
VALUE rb_tracepoint_new(VALUE target_thread_not_supported_yet, rb_event_flag_t events, void(*func)(VALUE, void *), void *data)
VALUE rb_tracepoint_disable(VALUE tpval)
VALUE rb_tracearg_path(rb_trace_arg_t *trace_arg)
VALUE rb_tracepoint_enable(VALUE tpval)
VALUE rb_tracearg_method_id(rb_trace_arg_t *trace_arg)
rb_trace_arg_t * rb_tracearg_from_tracepoint(VALUE tpval)
VALUE rb_tracearg_lineno(rb_trace_arg_t *trace_arg)
char str[HTML_ESCAPE_MAX_LEN+1]
VALUE rb_define_module(const char *)
int rb_bug_reporter_add(void(*func)(FILE *, void *), void *data)
VALUE rb_ensure(VALUE(*)(VALUE), VALUE, VALUE(*)(VALUE), VALUE)
An equivalent to ensure clause.
void Init_object_tracing(VALUE rb_mObjSpace)
struct allocation_info * objspace_lookup_allocation_info(VALUE obj)
int st_delete(st_table *tab, st_data_t *key, st_data_t *value)
void st_add_direct(st_table *tab, st_data_t key, st_data_t value)
st_table * st_init_numtable(void)
st_table * st_init_strtable(void)
int st_insert(st_table *tab, st_data_t key, st_data_t value)
void st_clear(st_table *tab)
int st_lookup(st_table *tab, st_data_t key, st_data_t *value)
int st_foreach(st_table *tab, st_foreach_callback_func *func, st_data_t arg)
int st_get_key(st_table *tab, st_data_t key, st_data_t *result)
struct traceobj_arg * prev_traceobj_arg