74 newobj_i(
VALUE tpval,
void *data)
107 info->
path = path_cstr;
116 freeobj_i(
VALUE tpval,
void *data)
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)
210 trace_object_allocations_stop(
VALUE self)
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;
293 fprintf(out,
"-- %p (%s F: %p, ", (
void *)obj, info->
living ?
"live" :
"dead", (
void *)info->
flags);
295 else fprintf(out,
"C: %p", (
void *)info->
klass);
296 fprintf(out,
"@%s:%lu", info->
path ? info->
path :
"", info->
line);
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);
329 lookup_allocation_info(
VALUE obj)
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);