Ruby  2.1.10p492(2016-04-01revision54464)
Data Structures | Functions | Variables
object_tracing.c File Reference
#include "ruby/ruby.h"
#include "ruby/debug.h"
#include "objspace.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  traceobj_arg
 

Functions

static const char * make_unique_str (st_table *tbl, const char *str, long len)
 
static void delete_unique_str (st_table *tbl, const char *str)
 
static void newobj_i (VALUE tpval, void *data)
 
static void freeobj_i (VALUE tpval, void *data)
 
static int free_keys_i (st_data_t key, st_data_t value, void *data)
 
static int free_values_i (st_data_t key, st_data_t value, void *data)
 
static struct traceobj_argget_traceobj_arg (void)
 
static VALUE trace_object_allocations_start (VALUE self)
 
static VALUE trace_object_allocations_stop (VALUE self)
 
static VALUE trace_object_allocations_clear (VALUE self)
 
static VALUE trace_object_allocations (VALUE self)
 
int rb_bug_reporter_add (void(*func)(FILE *, void *), void *data)
 
static int object_allocations_reporter_i (st_data_t key, st_data_t val, st_data_t ptr)
 
static void object_allocations_reporter (FILE *out, void *ptr)
 
static VALUE trace_object_allocations_debug_start (VALUE self)
 
static struct allocation_infolookup_allocation_info (VALUE obj)
 
struct allocation_infoobjspace_lookup_allocation_info (VALUE obj)
 
static VALUE allocation_sourcefile (VALUE self, VALUE obj)
 
static VALUE allocation_sourceline (VALUE self, VALUE obj)
 
static VALUE allocation_class_path (VALUE self, VALUE obj)
 
static VALUE allocation_method_id (VALUE self, VALUE obj)
 
static VALUE allocation_generation (VALUE self, VALUE obj)
 
void Init_object_tracing (VALUE rb_mObjSpace)
 

Variables

static struct traceobj_argtmp_trace_arg
 
static int tmp_keep_remains
 
static int object_allocations_reporter_registered = 0
 

Function Documentation

static VALUE allocation_class_path ( VALUE  self,
VALUE  obj 
)
static
static VALUE allocation_generation ( VALUE  self,
VALUE  obj 
)
static

Definition at line 460 of file object_tracing.c.

References allocation_info::generation, info, lookup_allocation_info(), Qnil, and SIZET2NUM.

Referenced by Init_object_tracing().

static VALUE allocation_method_id ( VALUE  self,
VALUE  obj 
)
static

Definition at line 428 of file object_tracing.c.

References info, lookup_allocation_info(), allocation_info::mid, and Qnil.

Referenced by Init_object_tracing().

static VALUE allocation_sourcefile ( VALUE  self,
VALUE  obj 
)
static

Definition at line 344 of file object_tracing.c.

References info, lookup_allocation_info(), allocation_info::path, Qnil, and rb_str_new2.

Referenced by Init_object_tracing().

static VALUE allocation_sourceline ( VALUE  self,
VALUE  obj 
)
static

Definition at line 364 of file object_tracing.c.

References info, INT2FIX, allocation_info::line, lookup_allocation_info(), and Qnil.

Referenced by Init_object_tracing().

static void delete_unique_str ( st_table tbl,
const char *  str 
)
static

Definition at line 56 of file object_tracing.c.

References n, ruby_xfree(), st_data_t, st_delete(), st_insert(), and st_lookup().

Referenced by freeobj_i(), and newobj_i().

static int free_keys_i ( st_data_t  key,
st_data_t  value,
void data 
)
static

Definition at line 134 of file object_tracing.c.

References ruby_xfree(), and ST_CONTINUE.

Referenced by trace_object_allocations_clear().

static int free_values_i ( st_data_t  key,
st_data_t  value,
void data 
)
static

Definition at line 141 of file object_tracing.c.

References ruby_xfree(), and ST_CONTINUE.

Referenced by trace_object_allocations_clear().

static void freeobj_i ( VALUE  tpval,
void data 
)
static
static struct traceobj_arg* get_traceobj_arg ( void  )
static
void Init_object_tracing ( VALUE  rb_mObjSpace)
static struct allocation_info* lookup_allocation_info ( VALUE  obj)
static
static const char* make_unique_str ( st_table tbl,
const char *  str,
long  len 
)
static

Definition at line 32 of file object_tracing.c.

References len, n, NULL, result, ruby_xmalloc(), st_add_direct(), st_data_t, st_get_key(), st_insert(), and st_lookup().

Referenced by newobj_i().

static void newobj_i ( VALUE  tpval,
void data 
)
static
static void object_allocations_reporter ( FILE out,
void ptr 
)
static
static int object_allocations_reporter_i ( st_data_t  key,
st_data_t  val,
st_data_t  ptr 
)
static
struct allocation_info* objspace_lookup_allocation_info ( VALUE  obj)

Definition at line 331 of file object_tracing.c.

References lookup_allocation_info().

Referenced by dump_object().

int rb_bug_reporter_add ( void(*)(FILE *, void *)  func,
void data 
)

Definition at line 282 of file error.c.

static VALUE trace_object_allocations ( VALUE  self)
static
static VALUE trace_object_allocations_clear ( VALUE  self)
static
static VALUE trace_object_allocations_debug_start ( VALUE  self)
static
static VALUE trace_object_allocations_start ( VALUE  self)
static
static VALUE trace_object_allocations_stop ( VALUE  self)
static

Variable Documentation

int object_allocations_reporter_registered = 0
static

Definition at line 277 of file object_tracing.c.

int tmp_keep_remains
static

Definition at line 148 of file object_tracing.c.

Referenced by get_traceobj_arg(), and trace_object_allocations_debug_start().

struct traceobj_arg* tmp_trace_arg
static

Definition at line 147 of file object_tracing.c.

Referenced by get_traceobj_arg().