Ruby 2.1.5p273(2014-11-13revision48405)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

objspace_dump.c
Go to the documentation of this file.
1 /**********************************************************************
2
3 objspace_dump.c - Heap dumping ObjectSpace extender for MRI.
4
5 $Author$
6 created at: Sat Oct 11 10:11:00 2013
7
8 NOTE: This extension library is not expected to exist except C Ruby.
9
10 All the files in this distribution are covered under the Ruby's
11 license (see the file COPYING).
12
13 **********************************************************************/
14
15 #include "ruby/ruby.h"
16 #include "ruby/debug.h"
17 #include "ruby/encoding.h"
18 #include "ruby/io.h"
19 #include "gc.h"
20 #include "node.h"
21 #include "vm_core.h"
22 #include "objspace.h"
23 #include "internal.h"
24
25 static VALUE sym_output, sym_stdout, sym_string, sym_file;
26
27 struct dump_config {
28 VALUE type;
29 FILE *stream;
30 VALUE string;
31 int roots;
32 const char *root_category;
33 VALUE cur_obj;
34 VALUE cur_obj_klass;
35 size_t cur_obj_references;
36 };
37
38 static void
39 dump_append(struct dump_config *dc, const char *format, ...)
40 {
41 va_list vl;
42 va_start(vl, format);
43
44 if (dc->stream) {
45 vfprintf(dc->stream, format, vl);
46 fflush(dc->stream);
47 }
48 else if (dc->string)
49 rb_str_vcatf(dc->string, format, vl);
50
51 va_end(vl);
52 }
53
54 static void
55 dump_append_string_value(struct dump_config *dc, VALUE obj)
56 {
57 int i;
58 char c, *value;
59
60 dump_append(dc, "\"");
61 for (i = 0, value = RSTRING_PTR(obj); i < RSTRING_LEN(obj); i++) {
62 switch ((c = value[i])) {
63 case '\\':
64 case '"':
65 dump_append(dc, "\\%c", c);
66 break;
67 case '\0':
68 dump_append(dc, "\\u0000");
69 break;
70 case '\b':
71 dump_append(dc, "\\b");
72 break;
73 case '\t':
74 dump_append(dc, "\\t");
75 break;
76 case '\f':
77 dump_append(dc, "\\f");
78 break;
79 case '\n':
80 dump_append(dc, "\\n");
81 break;
82 case '\r':
83 dump_append(dc, "\\r");
84 break;
85 default:
86 if (c <= 0x1f)
87 dump_append(dc, "\\u%04d", c);
88 else
89 dump_append(dc, "%c", c);
90 }
91 }
92 dump_append(dc, "\"");
93 }
94
95 static inline const char *
96 obj_type(VALUE obj)
97 {
98 switch (BUILTIN_TYPE(obj)) {
99 #define CASE_TYPE(type) case T_##type: return #type; break
100 CASE_TYPE(NONE);
101 CASE_TYPE(NIL);
102 CASE_TYPE(OBJECT);
103 CASE_TYPE(CLASS);
104 CASE_TYPE(ICLASS);
105 CASE_TYPE(MODULE);
106 CASE_TYPE(FLOAT);
107 CASE_TYPE(STRING);
108 CASE_TYPE(REGEXP);
109 CASE_TYPE(ARRAY);
110 CASE_TYPE(HASH);
111 CASE_TYPE(STRUCT);
112 CASE_TYPE(BIGNUM);
113 CASE_TYPE(FILE);
114 CASE_TYPE(FIXNUM);
115 CASE_TYPE(TRUE);
116 CASE_TYPE(FALSE);
117 CASE_TYPE(DATA);
118 CASE_TYPE(MATCH);
119 CASE_TYPE(SYMBOL);
120 CASE_TYPE(RATIONAL);
121 CASE_TYPE(COMPLEX);
122 CASE_TYPE(UNDEF);
123 CASE_TYPE(NODE);
124 CASE_TYPE(ZOMBIE);
125 #undef CASE_TYPE
126 }
127 return "UNKNOWN";
128 }
129
130 static void
131 reachable_object_i(VALUE ref, void *data)
132 {
133 struct dump_config *dc = (struct dump_config *)data;
134
135 if (dc->cur_obj_klass == ref)
136 return;
137
138 if (dc->cur_obj_references == 0)
139 dump_append(dc, ", \"references\":[\"%p\"", (void *)ref);
140 else
141 dump_append(dc, ", \"%p\"", (void *)ref);
142
143 dc->cur_obj_references++;
144 }
145
146 static void
147 dump_object(VALUE obj, struct dump_config *dc)
148 {
149 size_t memsize;
150 struct allocation_info *ainfo;
151 rb_io_t *fptr;
152 ID flags[RB_OBJ_GC_FLAGS_MAX];
153 size_t n, i;
154
155 dc->cur_obj = obj;
156 dc->cur_obj_references = 0;
157 dc->cur_obj_klass = BUILTIN_TYPE(obj) == T_NODE ? 0 : RBASIC_CLASS(obj);
158
159 if (dc->cur_obj == dc->string)
160 return;
161
162 dump_append(dc, "{\"address\":\"%p\", \"type\":\"%s\"", (void *)obj, obj_type(obj));
163
164 if (dc->cur_obj_klass)
165 dump_append(dc, ", \"class\":\"%p\"", (void *)dc->cur_obj_klass);
166 if (rb_obj_frozen_p(obj))
167 dump_append(dc, ", \"frozen\":true");
168
169 switch (BUILTIN_TYPE(obj)) {
170 case T_NODE:
171 dump_append(dc, ", \"node_type\":\"%s\"", ruby_node_name(nd_type(obj)));
172 break;
173
174 case T_STRING:
175 if (STR_EMBED_P(obj))
176 dump_append(dc, ", \"embedded\":true");
177 if (STR_ASSOC_P(obj))
178 dump_append(dc, ", \"associated\":true");
179 if (is_broken_string(obj))
180 dump_append(dc, ", \"broken\":true");
181 if (FL_TEST(obj, RSTRING_FSTR))
182 dump_append(dc, ", \"fstring\":true");
183 if (STR_SHARED_P(obj))
184 dump_append(dc, ", \"shared\":true");
185 else {
186 dump_append(dc, ", \"bytesize\":%ld", RSTRING_LEN(obj));
187 if (!STR_EMBED_P(obj) && !STR_NOCAPA_P(obj) && (long)rb_str_capacity(obj) != RSTRING_LEN(obj))
188 dump_append(dc, ", \"capacity\":%ld", rb_str_capacity(obj));
189
190 if (is_ascii_string(obj)) {
191 dump_append(dc, ", \"value\":");
192 dump_append_string_value(dc, obj);
193 }
194 }
195
196 if (!ENCODING_IS_ASCII8BIT(obj))
197 dump_append(dc, ", \"encoding\":\"%s\"", rb_enc_name(rb_enc_from_index(ENCODING_GET(obj))));
198 break;
199
200 case T_HASH:
201 dump_append(dc, ", \"size\":%ld", RHASH_SIZE(obj));
202 if (FL_TEST(obj, HASH_PROC_DEFAULT))
203 dump_append(dc, ", \"default\":\"%p\"", (void *)RHASH_IFNONE(obj));
204 break;
205
206 case T_ARRAY:
207 dump_append(dc, ", \"length\":%ld", RARRAY_LEN(obj));
208 if (RARRAY_LEN(obj) > 0 && FL_TEST(obj, ELTS_SHARED))
209 dump_append(dc, ", \"shared\":true");
210 if (RARRAY_LEN(obj) > 0 && FL_TEST(obj, RARRAY_EMBED_FLAG))
211 dump_append(dc, ", \"embedded\":true");
212 break;
213
214 case T_CLASS:
215 case T_MODULE:
216 if (dc->cur_obj_klass)
217 dump_append(dc, ", \"name\":\"%s\"", rb_class2name(obj));
218 break;
219
220 case T_DATA:
221 if (RTYPEDDATA_P(obj))
222 dump_append(dc, ", \"struct\":\"%s\"", RTYPEDDATA_TYPE(obj)->wrap_struct_name);
223 break;
224
225 case T_FLOAT:
226 dump_append(dc, ", \"value\":\"%g\"", RFLOAT_VALUE(obj));
227 break;
228
229 case T_OBJECT:
230 dump_append(dc, ", \"ivars\":%ld", ROBJECT_NUMIV(obj));
231 break;
232
233 case T_FILE:
234 fptr = RFILE(obj)->fptr;
235 if (fptr)
236 dump_append(dc, ", \"fd\":%d", fptr->fd);
237 break;
238
239 case T_ZOMBIE:
240 dump_append(dc, "}\n");
241 return;
242 }
243
244 rb_objspace_reachable_objects_from(obj, reachable_object_i, dc);
245 if (dc->cur_obj_references > 0)
246 dump_append(dc, "]");
247
248 if ((ainfo = objspace_lookup_allocation_info(obj))) {
249 dump_append(dc, ", \"file\":\"%s\", \"line\":%lu", ainfo->path, ainfo->line);
250 if (RTEST(ainfo->mid))
251 dump_append(dc, ", \"method\":\"%s\"", rb_id2name(SYM2ID(ainfo->mid)));
252 dump_append(dc, ", \"generation\":%"PRIuSIZE, ainfo->generation);
253 }
254
255 if ((memsize = rb_obj_memsize_of(obj)) > 0)
256 dump_append(dc, ", \"memsize\":%"PRIuSIZE, memsize);
257
258 if ((n = rb_obj_gc_flags(obj, flags, sizeof(flags))) > 0) {
259 dump_append(dc, ", \"flags\":{");
260 for (i=0; i<n; i++) {
261 dump_append(dc, "\"%s\":true", rb_id2name(flags[i]));
262 if (i != n-1) dump_append(dc, ", ");
263 }
264 dump_append(dc, "}");
265 }
266
267 dump_append(dc, "}\n");
268 }
269
270 static int
271 heap_i(void *vstart, void *vend, size_t stride, void *data)
272 {
273 VALUE v = (VALUE)vstart;
274 for (; v != (VALUE)vend; v += stride) {
275 if (RBASIC(v)->flags)
276 dump_object(v, data);
277 }
278 return 0;
279 }
280
281 static void
282 root_obj_i(const char *category, VALUE obj, void *data)
283 {
284 struct dump_config *dc = (struct dump_config *)data;
285
286 if (dc->root_category != NULL && category != dc->root_category)
287 dump_append(dc, "]}\n");
288 if (dc->root_category == NULL || category != dc->root_category)
289 dump_append(dc, "{\"type\":\"ROOT\", \"root\":\"%s\", \"references\":[\"%p\"", category, (void *)obj);
290 else
291 dump_append(dc, ", \"%p\"", (void *)obj);
292
293 dc->root_category = category;
294 dc->roots++;
295 }
296
297 static VALUE
298 dump_output(struct dump_config *dc, VALUE opts, VALUE output, const char *filename)
299 {
300 VALUE tmp;
301
302 if (RTEST(opts))
303 output = rb_hash_aref(opts, sym_output);
304
305 if (output == sym_stdout) {
306 dc->stream = stdout;
307 dc->string = Qnil;
308 }
309 else if (output == sym_file) {
310 rb_io_t *fptr;
311 rb_require("tempfile");
312 tmp = rb_assoc_new(rb_str_new_cstr(filename), rb_str_new_cstr(".json"));
313 tmp = rb_funcallv(rb_path2class("Tempfile"), rb_intern("create"), 1, &tmp);
314 io:
315 dc->string = rb_io_get_write_io(tmp);
316 rb_io_flush(dc->string);
317 GetOpenFile(dc->string, fptr);
318 dc->stream = rb_io_stdio_file(fptr);
319 }
320 else if (output == sym_string) {
321 dc->string = rb_str_new_cstr("");
322 }
323 else if (!NIL_P(tmp = rb_io_check_io(output))) {
324 output = sym_file;
325 goto io;
326 }
327 else {
328 rb_raise(rb_eArgError, "wrong output option: %"PRIsVALUE, output);
329 }
330 return output;
331 }
332
333 static VALUE
334 dump_result(struct dump_config *dc, VALUE output)
335 {
336 if (output == sym_string) {
337 return dc->string;
338 }
339 else if (output == sym_file) {
340 rb_io_flush(dc->string);
341 return dc->string;
342 }
343 else {
344 return Qnil;
345 }
346 }
347
348 /*
349 * call-seq:
350 * ObjectSpace.dump(obj[, output: :string]) # => "{ ... }"
351 * ObjectSpace.dump(obj, output: :file) # => #<File:/tmp/rubyobj20131125-88733-1xkfmpv.json>
352 * ObjectSpace.dump(obj, output: :stdout) # => nil
353 *
354 * Dump the contents of a ruby object as JSON.
355 *
356 * This method is only expected to work with C Ruby.
357 * This is an experimental method and is subject to change.
358 * In particular, the function signature and output format are
359 * not guaranteed to be compatible in future versions of ruby.
360 */
361
362 static VALUE
363 objspace_dump(int argc, VALUE *argv, VALUE os)
364 {
365 static const char filename[] = "rubyobj";
366 VALUE obj = Qnil, opts = Qnil, output;
367 struct dump_config dc = {0,};
368
369 rb_scan_args(argc, argv, "1:", &obj, &opts);
370
371 output = dump_output(&dc, opts, sym_string, filename);
372
373 dump_object(obj, &dc);
374
375 return dump_result(&dc, output);
376 }
377
378 /*
379 * call-seq:
380 * ObjectSpace.dump_all([output: :file]) # => #<File:/tmp/rubyheap20131125-88469-laoj3v.json>
381 * ObjectSpace.dump_all(output: :stdout) # => nil
382 * ObjectSpace.dump_all(output: :string) # => "{...}\n{...}\n..."
383 * ObjectSpace.dump_all(output:
384 * File.open('heap.json','w')) # => #<File:heap.json>
385 *
386 * Dump the contents of the ruby heap as JSON.
387 *
388 * This method is only expected to work with C Ruby.
389 * This is an experimental method and is subject to change.
390 * In particular, the function signature and output format are
391 * not guaranteed to be compatible in future versions of ruby.
392 */
393
394 static VALUE
395 objspace_dump_all(int argc, VALUE *argv, VALUE os)
396 {
397 static const char filename[] = "rubyheap";
398 VALUE opts = Qnil, output;
399 struct dump_config dc = {0,};
400
401 rb_scan_args(argc, argv, "0:", &opts);
402
403 output = dump_output(&dc, opts, sym_file, filename);
404
405 /* dump roots */
406 rb_objspace_reachable_objects_from_root(root_obj_i, &dc);
407 if (dc.roots) dump_append(&dc, "]}\n");
408
409 /* dump all objects */
410 rb_objspace_each_objects(heap_i, &dc);
411
412 return dump_result(&dc, output);
413 }
414
415 void
416 Init_objspace_dump(VALUE rb_mObjSpace)
417 {
418 #if 0
419 rb_mObjSpace = rb_define_module("ObjectSpace"); /* let rdoc know */
420 #endif
421
422 rb_define_module_function(rb_mObjSpace, "dump", objspace_dump, -1);
423 rb_define_module_function(rb_mObjSpace, "dump_all", objspace_dump_all, -1);
424
425 sym_output = ID2SYM(rb_intern("output"));
426 sym_stdout = ID2SYM(rb_intern("stdout"));
427 sym_string = ID2SYM(rb_intern("string"));
428 sym_file = ID2SYM(rb_intern("file"));
429
430 /* force create static IDs */
431 rb_obj_gc_flags(rb_mObjSpace, 0, 0);
432 }
ELTS_SHARED
#define ELTS_SHARED
Definition: ruby.h:817
root_obj_i
static void root_obj_i(const char *category, VALUE obj, void *data)
Definition: objspace_dump.c:282
dump_config::stream
FILE * stream
Definition: objspace_dump.c:29
T_OBJECT
#define T_OBJECT
Definition: ruby.h:477
sym_stdout
static VALUE sym_stdout
Definition: objspace_dump.c:25
is_broken_string
#define is_broken_string(str)
Definition: internal.h:730
RARRAY_LEN
#define RARRAY_LEN(a)
Definition: ruby.h:878
objspace_dump
static VALUE objspace_dump(int argc, VALUE *argv, VALUE os)
Definition: objspace_dump.c:363
FALSE
#define FALSE
Definition: nkf.h:174
RSTRING_FSTR
#define RSTRING_FSTR
Definition: ruby.h:835
RB_OBJ_GC_FLAGS_MAX
#define RB_OBJ_GC_FLAGS_MAX
Definition: internal.h:880
node.h
ruby.h
dump_object
static void dump_object(VALUE obj, struct dump_config *dc)
Definition: objspace_dump.c:147
T_MODULE
#define T_MODULE
Definition: ruby.h:480
dump_append
static void dump_append(struct dump_config *dc, const char *format,...)
Definition: objspace_dump.c:39
debug.h
is_ascii_string
#define is_ascii_string(str)
Definition: internal.h:729
rb_io_t
Definition: io.h:61
rb_io_flush
VALUE rb_io_flush(VALUE)
Definition: io.c:1510
dump_config::roots
int roots
Definition: objspace_dump.c:31
SYM2ID
#define SYM2ID(x)
Definition: ruby.h:356
UNDEF
#define UNDEF
Definition: transcode_data.h:33
rb_objspace_reachable_objects_from_root
void rb_objspace_reachable_objects_from_root(void(func)(const char *category, VALUE, void *), void *passing_data)
Definition: gc.c:5807
rb_raise
void rb_raise(VALUE exc, const char *fmt,...)
Definition: error.c:1857
gc.h
T_HASH
#define T_HASH
Definition: ruby.h:485
dump_config::root_category
const char * root_category
Definition: objspace_dump.c:32
rb_objspace_each_objects
void rb_objspace_each_objects(each_obj_callback *callback, void *data)
Definition: gc.c:1761
T_ARRAY
#define T_ARRAY
Definition: ruby.h:484
RFILE
#define RFILE(obj)
Definition: ruby.h:1129
ROBJECT_NUMIV
#define ROBJECT_NUMIV(o)
Definition: ruby.h:774
dump_config::cur_obj
VALUE cur_obj
Definition: objspace_dump.c:33
rb_path2class
VALUE rb_path2class(const char *)
Definition: variable.c:379
sym_string
static VALUE sym_string
Definition: objspace_dump.c:25
nd_type
#define nd_type(n)
Definition: node.h:282
GetOpenFile
#define GetOpenFile(obj, fp)
Definition: io.h:118
io.h
RHASH_IFNONE
#define RHASH_IFNONE(h)
Definition: ruby.h:929
sym_output
static VALUE sym_output
Definition: objspace_dump.c:25
__sFILE
Definition: vsnprintf.c:175
RNode
Definition: node.h:239
output
static unsigned char * output
Definition: nkf.c:32
allocation_info::generation
size_t generation
Definition: objspace.h:16
dump_config::cur_obj_klass
VALUE cur_obj_klass
Definition: objspace_dump.c:34
rb_obj_memsize_of
size_t rb_obj_memsize_of(VALUE obj)
Definition: gc.c:2548
rb_require
VALUE rb_require(const char *)
Definition: load.c:1034
FL_TEST
#define FL_TEST(x, f)
Definition: ruby.h:1169
reachable_object_i
static void reachable_object_i(VALUE ref, void *data)
Definition: objspace_dump.c:131
rb_io_get_write_io
VALUE rb_io_get_write_io(VALUE io)
Definition: io.c:639
dump_append_string_value
static void dump_append_string_value(struct dump_config *dc, VALUE obj)
Definition: objspace_dump.c:55
rb_io_check_io
VALUE rb_io_check_io(VALUE io)
Definition: io.c:633
NIL_P
#define NIL_P(v)
Definition: ruby.h:438
rb_io_t::fd
int fd
Definition: io.h:62
allocation_info::line
unsigned long line
Definition: objspace.h:13
MATCH
#define MATCH(s, p, c)
Definition: date_parse.c:267
T_FLOAT
#define T_FLOAT
Definition: ruby.h:481
dump_config::string
VALUE string
Definition: objspace_dump.c:30
argc
int argc
Definition: ruby.c:131
STR_ASSOC_P
#define STR_ASSOC_P(s)
Definition: internal.h:725
T_NODE
#define T_NODE
Definition: ruby.h:498
STR_SHARED_P
#define STR_SHARED_P(s)
Definition: internal.h:724
HASH_PROC_DEFAULT
#define HASH_PROC_DEFAULT
Definition: internal.h:482
encoding.h
dump_output
static VALUE dump_output(struct dump_config *dc, VALUE opts, VALUE output, const char *filename)
Definition: objspace_dump.c:298
rb_str_capacity
size_t rb_str_capacity(VALUE)
Definition: string.c:468
objspace_dump_all
static VALUE objspace_dump_all(int argc, VALUE *argv, VALUE os)
Definition: objspace_dump.c:395
RSTRING_LEN
#define RSTRING_LEN(str)
Definition: ruby.h:841
rb_define_module_function
void rb_define_module_function(VALUE module, const char *name, VALUE(*func)(ANYARGS), int argc)
Defines a module function for module.
Definition: class.c:1670
TRUE
#define TRUE
Definition: nkf.h:175
T_DATA
#define T_DATA
Definition: ruby.h:492
rb_enc_name
#define rb_enc_name(enc)
Definition: encoding.h:125
rb_obj_gc_flags
size_t rb_obj_gc_flags(VALUE obj, ID *flags, size_t max)
Definition: gc.c:4848
rb_str_vcatf
VALUE rb_str_vcatf(VALUE, const char *, va_list)
Definition: sprintf.c:1263
rb_scan_args
int rb_scan_args(int argc, const VALUE *argv, const char *fmt,...)
Definition: class.c:1728
rb_assoc_new
VALUE rb_assoc_new(VALUE car, VALUE cdr)
Definition: array.c:616
PRIsVALUE
#define PRIsVALUE
Definition: ruby.h:137
internal.h
ID
unsigned long ID
Definition: ruby.h:89
RHASH_SIZE
#define RHASH_SIZE(h)
Definition: ruby.h:930
STRING
#define STRING(string, length)
Definition: yaml_private.h:128
Qnil
#define Qnil
Definition: ruby.h:427
vm_core.h
BUILTIN_TYPE
#define BUILTIN_TYPE(x)
Definition: ruby.h:502
VALUE
unsigned long VALUE
Definition: ruby.h:88
RBASIC
#define RBASIC(obj)
Definition: ruby.h:1116
RARRAY_EMBED_FLAG
#define RARRAY_EMBED_FLAG
Definition: ruby.h:874
rb_class2name
const char * rb_class2name(VALUE)
Definition: variable.c:397
heap_i
static int heap_i(void *vstart, void *vend, size_t stride, void *data)
Definition: objspace_dump.c:271
Init_objspace_dump
void Init_objspace_dump(VALUE rb_mObjSpace)
Definition: objspace_dump.c:416
rb_str_new_cstr
VALUE rb_str_new_cstr(const char *)
Definition: string.c:560
dump_result
static VALUE dump_result(struct dump_config *dc, VALUE output)
Definition: objspace_dump.c:334
ENCODING_IS_ASCII8BIT
#define ENCODING_IS_ASCII8BIT(obj)
Definition: encoding.h:43
RTYPEDDATA_P
#define RTYPEDDATA_P(v)
Definition: ruby.h:994
dump_config::type
VALUE type
Definition: objspace_dump.c:28
obj_type
static const char * obj_type(VALUE obj)
Definition: objspace_dump.c:96
dump_config
Definition: objspace_dump.c:27
RSTRING_PTR
#define RSTRING_PTR(str)
Definition: ruby.h:845
objspace_lookup_allocation_info
struct allocation_info * objspace_lookup_allocation_info(VALUE obj)
Definition: object_tracing.c:331
ENCODING_GET
#define ENCODING_GET(obj)
Definition: encoding.h:38
RFLOAT_VALUE
#define RFLOAT_VALUE(v)
Definition: ruby.h:814
rb_funcallv
VALUE rb_funcallv(VALUE, ID, int, const VALUE *)
Calls a method.
Definition: vm_eval.c:806
allocation_info::mid
VALUE mid
Definition: objspace.h:15
rb_objspace_reachable_objects_from
void rb_objspace_reachable_objects_from(VALUE obj, void(func)(VALUE, void *), void *data)
Definition: gc.c:5779
sym_file
static VALUE sym_file
Definition: objspace_dump.c:25
RBASIC_CLASS
#define RBASIC_CLASS(obj)
Definition: ruby.h:759
rb_hash_aref
VALUE rb_hash_aref(VALUE hash, VALUE key)
Definition: hash.c:697
rb_obj_frozen_p
VALUE rb_obj_frozen_p(VALUE)
Definition: object.c:1102
ruby_node_name
const char * ruby_node_name(int node)
Definition: iseq.c:1603
RTEST
#define RTEST(v)
Definition: ruby.h:437
T_STRING
#define T_STRING
Definition: ruby.h:482
PRIuSIZE
#define PRIuSIZE
Definition: ruby.h:179
T_FILE
#define T_FILE
Definition: ruby.h:488
rb_io_stdio_file
FILE * rb_io_stdio_file(rb_io_t *fptr)
Definition: io.c:7247
T_CLASS
#define T_CLASS
Definition: ruby.h:478
ID2SYM
#define ID2SYM(x)
Definition: ruby.h:355
rb_id2name
const char * rb_id2name(ID id)
Definition: ripper.c:17230
STR_NOCAPA_P
#define STR_NOCAPA_P(s)
Definition: internal.h:727
CASE_TYPE
#define CASE_TYPE(type)
rb_define_module
VALUE rb_define_module(const char *name)
Definition: class.c:746
rb_intern
#define rb_intern(str)
T_ZOMBIE
#define T_ZOMBIE
Definition: ruby.h:499
allocation_info
Definition: objspace.h:5
dump_config::cur_obj_references
size_t cur_obj_references
Definition: objspace_dump.c:35
allocation_info::flags
VALUE flags
Definition: objspace.h:8
NULL
#define NULL
Definition: _sdbm.c:103
RTYPEDDATA_TYPE
#define RTYPEDDATA_TYPE(v)
Definition: ruby.h:995
allocation_info::path
const char * path
Definition: objspace.h:12
objspace.h
rb_eArgError
VALUE rb_eArgError
Definition: error.c:549
STR_EMBED_P
#define STR_EMBED_P(str)
Definition: internal.h:728
argv
char ** argv
Definition: ruby.c:132
rb_enc_from_index
rb_encoding * rb_enc_from_index(int index)
Definition: encoding.c:590