Class: Majo::AllocationInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/majo/allocation_info.rb,
ext/majo/allocation_info.c

Instance Method Summary collapse

Instance Method Details

#alloc_generationObject



93
94
95
96
97
# File 'ext/majo/allocation_info.c', line 93

static VALUE
allocation_info_alloc_generation(VALUE self) {
  majo_allocation_info *info = majo_check_allocation_info(self);
  return SIZET2NUM(info->alloc_generation);
}

#class_pathObject



54
55
56
57
58
59
60
61
62
# File 'ext/majo/allocation_info.c', line 54

static VALUE
allocation_info_class_path(VALUE self) {
  majo_allocation_info *info = majo_check_allocation_info(self);
  if (info->class_path) {
    return rb_str_new2(info->class_path);
  } else {
    return Qnil;
  }
}

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
14
15
16
17
18
19
20
21
# File 'lib/majo/allocation_info.rb', line 11

def eql?(other)
  other.is_a?(AllocationInfo) &&
    path == other.path &&
    class_path == other.class_path &&
    method_id == other.method_id &&
    line == other.line &&
    object_class_path == other.object_class_path &&
    alloc_generation == other.alloc_generation &&
    free_generation == other.free_generation &&
    memsize == other.memsize
end

#free_generationObject



99
100
101
102
103
104
105
106
# File 'ext/majo/allocation_info.c', line 99

static VALUE
allocation_info_free_generation(VALUE self) {
  majo_allocation_info *info = majo_check_allocation_info(self);
  if (info->free_generation == 0) {
    return Qnil;
  }
  return SIZET2NUM(info->free_generation);
}

#hashObject



7
8
9
# File 'lib/majo/allocation_info.rb', line 7

def hash
  path.hash ^ class_path.hash ^ method_id.hash ^ line.hash ^ object_class_path.hash ^ alloc_generation.hash ^ free_generation.hash ^ memsize.hash
end

#inspectObject



3
4
5
# File 'lib/majo/allocation_info.rb', line 3

def inspect
  "#<Majo::AllocationInfo #{object_class_path} #{class_path}##{method_id} #{path}:#{line} gen#{alloc_generation}..#{free_generation}>"
end

#lineObject



74
75
76
77
78
# File 'ext/majo/allocation_info.c', line 74

static VALUE
allocation_info_line(VALUE self) {
  majo_allocation_info *info = majo_check_allocation_info(self);
  return LONG2NUM(info->line);
}

#memsizeObject



108
109
110
111
112
# File 'ext/majo/allocation_info.c', line 108

static VALUE
allocation_info_memsize(VALUE self) {
  majo_allocation_info *info = majo_check_allocation_info(self);
  return SIZET2NUM(info->memsize);
}

#method_idObject



81
82
83
84
85
# File 'ext/majo/allocation_info.c', line 81

static VALUE
allocation_info_method_id(VALUE self) {
  majo_allocation_info *info = majo_check_allocation_info(self);
  return info->mid;
}

#object_class_pathObject



64
65
66
67
68
69
70
71
72
# File 'ext/majo/allocation_info.c', line 64

static VALUE
allocation_info_object_class_path(VALUE self) {
  majo_allocation_info *info = majo_check_allocation_info(self);
  if (info->object_class_path) {
    return rb_str_new2(info->object_class_path);
  } else {
    return Qnil;
  }
}

#pathObject



44
45
46
47
48
49
50
51
52
# File 'ext/majo/allocation_info.c', line 44

static VALUE
allocation_info_path(VALUE self) {
  majo_allocation_info *info = majo_check_allocation_info(self);
  if (info->path) {
    return rb_str_new2(info->path);
  } else {
    return Qnil;
  }
}

#singleton?Boolean

Returns:

  • (Boolean)


87
88
89
90
91
# File 'ext/majo/allocation_info.c', line 87

static VALUE
allocation_info_singleton_p(VALUE self) {
  majo_allocation_info *info = majo_check_allocation_info(self);
  return info->singleton_p ? Qtrue : Qfalse;
}