46 strncpy(result, str, len);
100 info->flags =
RBASIC(obj)->flags;
103 info->path = path_cstr;
106 info->class_path = class_path_cstr;
152 if (tmp_trace_arg == 0) {
285 fprintf(out,
"-- %p (%s F: %p, ", (
void *)obj, info->
living ?
"live" :
"dead", (
void *)info->
flags);
287 else fprintf(out,
"C: %p", (
void *)info->
klass);
288 fprintf(out,
"@%s:%lu", info->
path ? info->
path :
"", info->
line);
301 fprintf(out,
"== object_allocations_reporter: START\n");
305 fprintf(out,
"== object_allocations_reporter: END\n");
350 if (info && info->
path) {
static VALUE trace_object_allocations(VALUE self)
SSL_METHOD *(* func)(void)
int st_get_key(st_table *, st_data_t, st_data_t *)
static VALUE allocation_sourceline(VALUE self, VALUE obj)
static VALUE trace_object_allocations_stop(VALUE self)
static int free_keys_i(st_data_t key, st_data_t value, void *data)
RUBY_SYMBOL_EXPORT_BEGIN typedef unsigned long st_data_t
struct traceobj_arg * prev_traceobj_arg
static VALUE allocation_method_id(VALUE self, VALUE obj)
static int free_values_i(st_data_t key, st_data_t value, void *data)
int rb_bug_reporter_add(void(*func)(FILE *, void *), void *data)
static int tmp_keep_remains
void Init_object_tracing(VALUE rb_mObjSpace)
static VALUE allocation_class_path(VALUE self, VALUE obj)
static struct traceobj_arg * tmp_trace_arg
static struct traceobj_arg * get_traceobj_arg(void)
rb_trace_arg_t * rb_tracearg_from_tracepoint(VALUE tpval)
void rb_define_module_function(VALUE module, const char *name, VALUE(*func)(ANYARGS), int argc)
Defines a module function for module.
VALUE rb_tracearg_method_id(rb_trace_arg_t *trace_arg)
static void delete_unique_str(st_table *tbl, const char *str)
VALUE rb_tracearg_defined_class(rb_trace_arg_t *trace_arg)
static void freeobj_i(VALUE tpval, void *data)
static int object_allocations_reporter_i(st_data_t key, st_data_t val, st_data_t ptr)
VALUE rb_tracepoint_new(VALUE target_thread_not_supported_yet, rb_event_flag_t events, void(*func)(VALUE, void *), void *data)
VALUE rb_tracearg_lineno(rb_trace_arg_t *trace_arg)
VALUE rb_ensure(VALUE(*b_proc)(ANYARGS), VALUE data1, VALUE(*e_proc)(ANYARGS), VALUE data2)
static VALUE allocation_sourcefile(VALUE self, VALUE obj)
static const char * make_unique_str(st_table *tbl, const char *str, long len)
register unsigned int len
void * ruby_xmalloc(size_t size)
struct allocation_info * objspace_lookup_allocation_info(VALUE obj)
static int object_allocations_reporter_registered
VALUE rb_tracearg_object(rb_trace_arg_t *trace_arg)
static VALUE trace_object_allocations_debug_start(VALUE self)
static struct allocation_info * lookup_allocation_info(VALUE obj)
#define RUBY_INTERNAL_EVENT_NEWOBJ
#define RUBY_INTERNAL_EVENT_FREEOBJ
#define RBASIC_CLASS(obj)
VALUE rb_class_path_cached(VALUE)
VALUE rb_tracearg_path(rb_trace_arg_t *trace_arg)
static VALUE trace_object_allocations_clear(VALUE self)
VALUE rb_tracepoint_enable(VALUE tpval)
static VALUE allocation_generation(VALUE self, VALUE obj)
void st_clear(st_table *)
VALUE rb_define_module(const char *name)
static void object_allocations_reporter(FILE *out, void *ptr)
VALUE rb_tracepoint_disable(VALUE tpval)
static void newobj_i(VALUE tpval, void *data)
static VALUE trace_object_allocations_start(VALUE self)