74 newobj_i(
VALUE tpval,
void *data)
91 if (
arg->keep_remains) {
97 delete_unique_str(
arg->str_table, info->
path);
107 info->
path = path_cstr;
116 freeobj_i(
VALUE tpval,
void *data)
124 if (
arg->keep_remains) {
133 delete_unique_str(
arg->str_table, info->
path);
155 static int tmp_keep_remains;
158 get_traceobj_arg(
void)
160 if (tmp_trace_arg == 0) {
169 return tmp_trace_arg;
179 trace_object_allocations_start(
VALUE self)
183 if (
arg->running++ > 0) {
187 if (
arg->newobj_trace == 0) {
210 trace_object_allocations_stop(
VALUE self)
214 if (
arg->running > 0) {
218 if (
arg->running == 0) {
233 trace_object_allocations_clear(
VALUE self)
277 trace_object_allocations(
VALUE self)
279 trace_object_allocations_start(
self);
284 static int object_allocations_reporter_registered = 0;
307 object_allocations_reporter(
FILE *out,
void *
ptr)
309 fprintf(out,
"== object_allocations_reporter: START\n");
313 fprintf(out,
"== object_allocations_reporter: END\n");
317 trace_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);