Ruby 3.2.1p31 (2023-02-08 revision 31819e82c88c6f8ecfaeb162519bfa26a14b21fd)
debug.c
1/**********************************************************************
2
3 debug.c -
4
5 $Author$
6 created at: 04/08/25 02:31:54 JST
7
8 Copyright (C) 2004-2007 Koichi Sasada
9
10**********************************************************************/
11
12#include "ruby/internal/config.h"
13
14#include <stdio.h>
15
16#include "eval_intern.h"
17#include "encindex.h"
18#include "id.h"
19#include "internal/signal.h"
20#include "ruby/encoding.h"
21#include "ruby/io.h"
22#include "ruby/ruby.h"
23#include "ruby/util.h"
24#include "symbol.h"
25#include "vm_core.h"
26#include "vm_debug.h"
27#include "vm_callinfo.h"
28#include "ruby/thread_native.h"
29#include "ractor_core.h"
30
31/* This is the only place struct RIMemo is actually used */
32struct RIMemo {
33 VALUE flags;
34 VALUE v0;
35 VALUE v1;
36 VALUE v2;
37 VALUE v3;
38};
39
40/* for gdb */
41const union {
42 enum ruby_special_consts special_consts;
43 enum ruby_value_type value_type;
44 enum ruby_tag_type tag_type;
45 enum node_type node_type;
46 enum ruby_method_ids method_ids;
47 enum ruby_id_types id_types;
48 enum ruby_fl_type fl_types;
49 enum ruby_fl_ushift fl_ushift;
50 enum ruby_encoding_consts encoding_consts;
51 enum ruby_coderange_type enc_coderange_types;
52 enum ruby_econv_flag_type econv_flag_types;
53 rb_econv_result_t econv_result;
54 enum ruby_preserved_encindex encoding_index;
55 enum ruby_robject_flags robject_flags;
56#if !USE_RVARGC
57 enum ruby_robject_consts robject_consts;
58#endif
59 enum ruby_rmodule_flags rmodule_flags;
60 enum ruby_rstring_flags rstring_flags;
61#if !USE_RVARGC
62 enum ruby_rstring_consts rstring_consts;
63#endif
64 enum ruby_rarray_flags rarray_flags;
65 enum ruby_rarray_consts rarray_consts;
66 enum {
67 RUBY_FMODE_READABLE = FMODE_READABLE,
68 RUBY_FMODE_WRITABLE = FMODE_WRITABLE,
69 RUBY_FMODE_READWRITE = FMODE_READWRITE,
70 RUBY_FMODE_BINMODE = FMODE_BINMODE,
71 RUBY_FMODE_SYNC = FMODE_SYNC,
72 RUBY_FMODE_TTY = FMODE_TTY,
73 RUBY_FMODE_DUPLEX = FMODE_DUPLEX,
74 RUBY_FMODE_APPEND = FMODE_APPEND,
75 RUBY_FMODE_CREATE = FMODE_CREATE,
76 RUBY_FMODE_NOREVLOOKUP = 0x00000100,
77 RUBY_FMODE_TRUNC = FMODE_TRUNC,
78 RUBY_FMODE_TEXTMODE = FMODE_TEXTMODE,
79 RUBY_FMODE_PREP = 0x00010000,
80 RUBY_FMODE_SETENC_BY_BOM = FMODE_SETENC_BY_BOM,
81 RUBY_FMODE_UNIX = 0x00200000,
82 RUBY_FMODE_INET = 0x00400000,
83 RUBY_FMODE_INET6 = 0x00800000,
84
85 RUBY_NODE_TYPESHIFT = NODE_TYPESHIFT,
86 RUBY_NODE_TYPEMASK = NODE_TYPEMASK,
87 RUBY_NODE_LSHIFT = NODE_LSHIFT,
88 RUBY_NODE_FL_NEWLINE = NODE_FL_NEWLINE
89 } various;
90 union {
91 enum imemo_type types;
92 enum {RUBY_IMEMO_MASK = IMEMO_MASK} mask;
93 struct RIMemo *ptr;
94 } imemo;
95 struct RSymbol *symbol_ptr;
96 enum vm_call_flag_bits vm_call_flags;
97} ruby_dummy_gdb_enums;
98
99const SIGNED_VALUE RUBY_NODE_LMASK = NODE_LMASK;
100
101int
102ruby_debug_print_indent(int level, int debug_level, int indent_level)
103{
104 if (level < debug_level) {
105 fprintf(stderr, "%*s", indent_level, "");
106 fflush(stderr);
107 return TRUE;
108 }
109 return FALSE;
110}
111
112void
113ruby_debug_printf(const char *format, ...)
114{
115 va_list ap;
116 va_start(ap, format);
117 vfprintf(stderr, format, ap);
118 va_end(ap);
119}
120
121#include "gc.h"
122
123VALUE
124ruby_debug_print_value(int level, int debug_level, const char *header, VALUE obj)
125{
126 if (level < debug_level) {
127 char buff[0x100];
128 rb_raw_obj_info(buff, 0x100, obj);
129
130 fprintf(stderr, "DBG> %s: %s\n", header, buff);
131 fflush(stderr);
132 }
133 return obj;
134}
135
136void
137ruby_debug_print_v(VALUE v)
138{
139 ruby_debug_print_value(0, 1, "", v);
140}
141
142ID
143ruby_debug_print_id(int level, int debug_level, const char *header, ID id)
144{
145 if (level < debug_level) {
146 fprintf(stderr, "DBG> %s: %s\n", header, rb_id2name(id));
147 fflush(stderr);
148 }
149 return id;
150}
151
152NODE *
153ruby_debug_print_node(int level, int debug_level, const char *header, const NODE *node)
154{
155 if (level < debug_level) {
156 fprintf(stderr, "DBG> %s: %s (%u)\n", header,
157 ruby_node_name(nd_type(node)), nd_line(node));
158 }
159 return (NODE *)node;
160}
161
162void
163ruby_debug_breakpoint(void)
164{
165 /* */
166}
167
168#if defined _WIN32
169# if RUBY_MSVCRT_VERSION >= 80
170extern int ruby_w32_rtc_error;
171# endif
172#endif
173#if defined _WIN32 || defined __CYGWIN__
174#include <windows.h>
175UINT ruby_w32_codepage[2];
176#endif
177extern int ruby_rgengc_debug;
178extern int ruby_on_ci;
179
180int
181ruby_env_debug_option(const char *str, int len, void *arg)
182{
183 int ov;
184 size_t retlen;
185 unsigned long n;
186#define SET_WHEN(name, var, val) do { \
187 if (len == sizeof(name) - 1 && \
188 strncmp(str, (name), len) == 0) { \
189 (var) = (val); \
190 return 1; \
191 } \
192 } while (0)
193#define NAME_MATCH_VALUE(name) \
194 ((size_t)len >= sizeof(name)-1 && \
195 strncmp(str, (name), sizeof(name)-1) == 0 && \
196 ((len == sizeof(name)-1 && !(len = 0)) || \
197 (str[sizeof(name)-1] == '=' && \
198 (str += sizeof(name), len -= sizeof(name), 1))))
199#define SET_UINT(val) do { \
200 n = ruby_scan_digits(str, len, 10, &retlen, &ov); \
201 if (!ov && retlen) { \
202 val = (unsigned int)n; \
203 } \
204 str += retlen; \
205 len -= retlen; \
206 } while (0)
207#define SET_UINT_LIST(name, vals, num) do { \
208 int i; \
209 for (i = 0; i < (num); ++i) { \
210 SET_UINT((vals)[i]); \
211 if (!len || *str != ':') break; \
212 ++str; \
213 --len; \
214 } \
215 if (len > 0) { \
216 fprintf(stderr, "ignored "name" option: `%.*s'\n", len, str); \
217 } \
218 } while (0)
219#define SET_WHEN_UINT(name, vals, num, req) \
220 if (NAME_MATCH_VALUE(name)) SET_UINT_LIST(name, vals, num);
221
222 SET_WHEN("gc_stress", *ruby_initial_gc_stress_ptr, Qtrue);
223 SET_WHEN("core", ruby_enable_coredump, 1);
224 SET_WHEN("ci", ruby_on_ci, 1);
225 if (NAME_MATCH_VALUE("rgengc")) {
226 if (!len) ruby_rgengc_debug = 1;
227 else SET_UINT_LIST("rgengc", &ruby_rgengc_debug, 1);
228 return 1;
229 }
230#if defined _WIN32
231# if RUBY_MSVCRT_VERSION >= 80
232 SET_WHEN("rtc_error", ruby_w32_rtc_error, 1);
233# endif
234#endif
235#if defined _WIN32 || defined __CYGWIN__
236 if (NAME_MATCH_VALUE("codepage")) {
237 if (!len) fprintf(stderr, "missing codepage argument");
238 else SET_UINT_LIST("codepage", ruby_w32_codepage, numberof(ruby_w32_codepage));
239 return 1;
240 }
241#endif
242 return 0;
243}
244
245static void
246set_debug_option(const char *str, int len, void *arg)
247{
248 if (!ruby_env_debug_option(str, len, arg)) {
249 fprintf(stderr, "unexpected debug option: %.*s\n", len, str);
250 }
251}
252
253#if USE_RUBY_DEBUG_LOG
254static void setup_debug_log(void);
255#else
256#define setup_debug_log()
257#endif
258
259void
260ruby_set_debug_option(const char *str)
261{
262 ruby_each_words(str, set_debug_option, 0);
263 setup_debug_log();
264}
265
266#if USE_RUBY_DEBUG_LOG
267
268// RUBY_DEBUG_LOG features
269// See vm_debug.h comments for details.
270
271#define MAX_DEBUG_LOG 0x1000
272#define MAX_DEBUG_LOG_MESSAGE_LEN 0x0200
273#define MAX_DEBUG_LOG_FILTER_LEN 0x0020
274#define MAX_DEBUG_LOG_FILTER_NUM 0x0010
275
276enum ruby_debug_log_mode ruby_debug_log_mode;
277
279 enum debug_log_filter_type {
280 dlf_all,
281 dlf_file, // "file:..."
282 dlf_func, // "func:..."
283 } type;
284 bool negative;
285 char str[MAX_DEBUG_LOG_FILTER_LEN];
286};
287
288static const char *dlf_type_names[] = {
289 "all",
290 "file",
291 "func",
292};
293
294static struct {
295 char *mem;
296 unsigned int cnt;
297 struct debug_log_filter filters[MAX_DEBUG_LOG_FILTER_NUM];
298 unsigned int filters_num;
300 FILE *output;
301} debug_log;
302
303static char *
304RUBY_DEBUG_LOG_MEM_ENTRY(unsigned int index)
305{
306 return &debug_log.mem[MAX_DEBUG_LOG_MESSAGE_LEN * index];
307}
308
309static enum debug_log_filter_type
310filter_type(const char *str, int *skiplen)
311{
312 if (strncmp(str, "file:", 5) == 0) {
313 *skiplen = 5;
314 return dlf_file;
315 }
316 else if(strncmp(str, "func:", 5) == 0) {
317 *skiplen = 5;
318 return dlf_func;
319 }
320 else {
321 *skiplen = 0;
322 return dlf_all;
323 }
324}
325
326static void
327setup_debug_log_filter(void)
328{
329 const char *filter_config = getenv("RUBY_DEBUG_LOG_FILTER");
330
331 if (filter_config && strlen(filter_config) > 0) {
332 unsigned int i;
333 for (i=0; i<MAX_DEBUG_LOG_FILTER_NUM && filter_config; i++) {
334 size_t len;
335 const char *str = filter_config;
336 const char *p;
337
338 if ((p = strchr(str, ',')) == NULL) {
339 len = strlen(str);
340 filter_config = NULL;
341 }
342 else {
343 len = p - str - 1; // 1 is ','
344 filter_config = p + 1;
345 }
346
347 // positive/negative
348 if (*str == '-') {
349 debug_log.filters[i].negative = true;
350 str++;
351 }
352 else if (*str == '+') {
353 // negative is false on default.
354 str++;
355 }
356
357 // type
358 int skiplen;
359 debug_log.filters[i].type = filter_type(str, &skiplen);
360 len -= skiplen;
361
362 if (len >= MAX_DEBUG_LOG_FILTER_LEN) {
363 fprintf(stderr, "too long: %s (max:%d)\n", str, MAX_DEBUG_LOG_FILTER_LEN - 1);
364 exit(1);
365 }
366
367 // body
368 strncpy(debug_log.filters[i].str, str + skiplen, len);
369 debug_log.filters[i].str[len] = 0;
370 }
371 debug_log.filters_num = i;
372
373 for (i=0; i<debug_log.filters_num; i++) {
374 fprintf(stderr, "RUBY_DEBUG_LOG_FILTER[%d]=%s (%s%s)\n", i,
375 debug_log.filters[i].str,
376 debug_log.filters[i].negative ? "-" : "",
377 dlf_type_names[debug_log.filters[i].type]);
378 }
379 }
380}
381
382static void
383setup_debug_log(void)
384{
385 // check RUBY_DEBUG_LOG
386 const char *log_config = getenv("RUBY_DEBUG_LOG");
387 if (log_config && strlen(log_config) > 0) {
388 if (strcmp(log_config, "mem") == 0) {
389 debug_log.mem = (char *)malloc(MAX_DEBUG_LOG * MAX_DEBUG_LOG_MESSAGE_LEN);
390 if (debug_log.mem == NULL) {
391 fprintf(stderr, "setup_debug_log failed (can't allocate memory)\n");
392 exit(1);
393 }
394 ruby_debug_log_mode |= ruby_debug_log_memory;
395 }
396 else if (strcmp(log_config, "stderr") == 0) {
397 ruby_debug_log_mode |= ruby_debug_log_stderr;
398 }
399 else {
400 ruby_debug_log_mode |= ruby_debug_log_file;
401 if ((debug_log.output = fopen(log_config, "w")) == NULL) {
402 fprintf(stderr, "can not open %s for RUBY_DEBUG_LOG\n", log_config);
403 exit(1);
404 }
405 setvbuf(debug_log.output, NULL, _IONBF, 0);
406 }
407
408 fprintf(stderr, "RUBY_DEBUG_LOG=%s %s%s%s\n", log_config,
409 (ruby_debug_log_mode & ruby_debug_log_memory) ? "[mem]" : "",
410 (ruby_debug_log_mode & ruby_debug_log_stderr) ? "[stderr]" : "",
411 (ruby_debug_log_mode & ruby_debug_log_file) ? "[file]" : "");
412 rb_nativethread_lock_initialize(&debug_log.lock);
413
414 setup_debug_log_filter();
415 }
416}
417
418static bool
419check_filter(const char *str, const struct debug_log_filter *filter, bool *state)
420{
421 if (filter->negative) {
422 if (strstr(str, filter->str) == NULL) {
423 *state = true;
424 return false;
425 }
426 else {
427 *state = false;
428 return true;
429 }
430 }
431 else {
432 if (strstr(str, filter->str) != NULL) {
433 *state = true;
434 return true;
435 }
436 else {
437 *state = false;
438 return false;
439 }
440 }
441}
442
443//
444// RUBY_DEBUG_LOG_FILTER=-foo,-bar,baz,boo
445// returns true if
446// (func_name or file_name) doesn't contain foo
447// and
448// (func_name or file_name) doesn't contain bar
449// and
450// (func_name or file_name) contains baz or boo
451//
452// RUBY_DEBUG_LOG_FILTER=foo,bar,-baz,-boo
453// retunrs true if
454// (func_name or file_name) contains foo or bar
455// or
456// (func_name or file_name) doesn't contain baz and
457// (func_name or file_name) doesn't contain boo and
458//
459// You can specify "file:" (ex file:foo) or "func:" (ex func:foo)
460// prefixes to specify the filter for.
461//
462bool
463ruby_debug_log_filter(const char *func_name, const char *file_name)
464{
465 if (debug_log.filters_num > 0) {
466 bool state = false;
467
468 for (unsigned int i = 0; i<debug_log.filters_num; i++) {
469 const struct debug_log_filter *filter = &debug_log.filters[i];
470
471 switch (filter->type) {
472 case dlf_all:
473 if (check_filter(func_name, filter, &state)) return state;
474 if (check_filter(file_name, filter, &state)) return state;
475 break;
476 case dlf_func:
477 if (check_filter(func_name, filter, &state)) return state;
478 break;
479 case dlf_file:
480 if (check_filter(file_name, filter, &state)) return state;
481 break;
482 }
483 }
484 return state;
485 }
486 else {
487 return true;
488 }
489}
490
491static const char *
492pretty_filename(const char *path)
493{
494 // basename is one idea.
495 const char *s;
496 while ((s = strchr(path, '/')) != NULL) {
497 path = s+1;
498 }
499 return path;
500}
501
502#undef ruby_debug_log
503void
504ruby_debug_log(const char *file, int line, const char *func_name, const char *fmt, ...)
505{
506 char buff[MAX_DEBUG_LOG_MESSAGE_LEN] = {0};
507 int len = 0;
508 int r = 0;
509
510 // message title
511 if (func_name && len < MAX_DEBUG_LOG_MESSAGE_LEN) {
512 r = snprintf(buff + len, MAX_DEBUG_LOG_MESSAGE_LEN, "%s\t", func_name);
513 if (r < 0) rb_bug("ruby_debug_log returns %d\n", r);
514 len += r;
515 }
516
517 // message
518 if (fmt && len < MAX_DEBUG_LOG_MESSAGE_LEN) {
519 va_list args;
520 va_start(args, fmt);
521 r = vsnprintf(buff + len, MAX_DEBUG_LOG_MESSAGE_LEN - len, fmt, args);
522 va_end(args);
523 if (r < 0) rb_bug("ruby_debug_log vsnprintf() returns %d", r);
524 len += r;
525 }
526
527 // optional information
528
529 // C location
530 if (file && len < MAX_DEBUG_LOG_MESSAGE_LEN) {
531 r = snprintf(buff + len, MAX_DEBUG_LOG_MESSAGE_LEN, "\t%s:%d", pretty_filename(file), line);
532 if (r < 0) rb_bug("ruby_debug_log returns %d\n", r);
533 len += r;
534 }
535
536 if (rb_current_execution_context(false)) {
537 // Ruby location
538 int ruby_line;
539 const char *ruby_file = rb_source_location_cstr(&ruby_line);
540 if (len < MAX_DEBUG_LOG_MESSAGE_LEN) {
541 if (ruby_file) {
542 r = snprintf(buff + len, MAX_DEBUG_LOG_MESSAGE_LEN - len, "\t%s:%d", pretty_filename(ruby_file), ruby_line);
543 }
544 else {
545 r = snprintf(buff + len, MAX_DEBUG_LOG_MESSAGE_LEN - len, "\t");
546 }
547 if (r < 0) rb_bug("ruby_debug_log returns %d\n", r);
548 len += r;
549 }
550
551 // ractor information
552 if (ruby_single_main_ractor == NULL) {
553 rb_ractor_t *cr = GET_RACTOR();
554 if (r && len < MAX_DEBUG_LOG_MESSAGE_LEN) {
555 r = snprintf(buff + len, MAX_DEBUG_LOG_MESSAGE_LEN - len, "\tr:#%u/%u",
556 (unsigned int)rb_ractor_id(cr), GET_VM()->ractor.cnt);
557 if (r < 0) rb_bug("ruby_debug_log returns %d\n", r);
558 len += r;
559 }
560 }
561
562 // thread information
563 const rb_thread_t *th = GET_THREAD();
564 if (r && len < MAX_DEBUG_LOG_MESSAGE_LEN) {
565 r = snprintf(buff + len, MAX_DEBUG_LOG_MESSAGE_LEN - len, "\tth:%u", rb_th_serial(th));
566 if (r < 0) rb_bug("ruby_debug_log returns %d\n", r);
567 len += r;
568 }
569 }
570
571 rb_nativethread_lock_lock(&debug_log.lock);
572 {
573 unsigned int cnt = debug_log.cnt++;
574
575 if (ruby_debug_log_mode & ruby_debug_log_memory) {
576 unsigned int index = cnt % MAX_DEBUG_LOG;
577 char *dst = RUBY_DEBUG_LOG_MEM_ENTRY(index);
578 strncpy(dst, buff, MAX_DEBUG_LOG_MESSAGE_LEN);
579 }
580 if (ruby_debug_log_mode & ruby_debug_log_stderr) {
581 fprintf(stderr, "%4u: %s\n", cnt, buff);
582 }
583 if (ruby_debug_log_mode & ruby_debug_log_file) {
584 fprintf(debug_log.output, "%u\t%s\n", cnt, buff);
585 }
586 }
587 rb_nativethread_lock_unlock(&debug_log.lock);
588}
589
590// for debugger
591static void
592debug_log_dump(FILE *out, unsigned int n)
593{
594 if (ruby_debug_log_mode & ruby_debug_log_memory) {
595 unsigned int size = debug_log.cnt > MAX_DEBUG_LOG ? MAX_DEBUG_LOG : debug_log.cnt;
596 unsigned int current_index = debug_log.cnt % MAX_DEBUG_LOG;
597 if (n == 0) n = size;
598 if (n > size) n = size;
599
600 for (unsigned int i=0; i<n; i++) {
601 int index = current_index - size + i;
602 if (index < 0) index += MAX_DEBUG_LOG;
603 VM_ASSERT(index <= MAX_DEBUG_LOG);
604 const char *mesg = RUBY_DEBUG_LOG_MEM_ENTRY(index);;
605 fprintf(out, "%4u: %s\n", debug_log.cnt - size + i, mesg);
606 }
607 }
608 else {
609 fprintf(stderr, "RUBY_DEBUG_LOG=mem is not specified.");
610 }
611}
612
613// for debuggers
614
615void
616ruby_debug_log_print(unsigned int n)
617{
618 debug_log_dump(stderr, n);
619}
620
621void
622ruby_debug_log_dump(const char *fname, unsigned int n)
623{
624 FILE *fp = fopen(fname, "w");
625 if (fp == NULL) {
626 fprintf(stderr, "can't open %s. give up.\n", fname);
627 }
628 else {
629 debug_log_dump(fp, n);
630 fclose(fp);
631 }
632}
633#endif // #if USE_RUBY_DEBUG_LOG
ruby_coderange_type
What rb_enc_str_coderange() returns.
Definition coderange.h:33
ruby_fl_ushift
This is an enum because GDB wants it (rather than a macro).
Definition fl_type.h:162
ruby_fl_type
The flags.
Definition fl_type.h:193
#define Qtrue
Old name of RUBY_Qtrue.
void rb_bug(const char *fmt,...)
Interpreter panic switch.
Definition error.c:794
Encoding relates APIs.
rb_econv_result_t
return value of rb_econv_convert()
Definition transcode.h:30
ruby_econv_flag_type
This enum is kind of omnibus.
Definition transcode.h:452
const char * rb_id2name(ID id)
Retrieves the name mapped to the given id.
Definition symbol.c:959
#define FMODE_READABLE
The IO is opened for reading.
Definition io.h:251
#define FMODE_SETENC_BY_BOM
This flag amends the encoding of the IO so that the BOM of the contents of the IO takes effect.
Definition io.h:340
#define FMODE_READWRITE
The IO is opened for both read/write.
Definition io.h:257
#define FMODE_TTY
The IO is a TTY.
Definition io.h:281
#define FMODE_CREATE
The IO is opened for creating.
Definition io.h:304
#define FMODE_WRITABLE
The IO is opened for writing.
Definition io.h:254
#define FMODE_APPEND
The IO is opened for appending.
Definition io.h:296
#define FMODE_DUPLEX
Ruby eventually detects that the IO is bidirectional.
Definition io.h:289
#define FMODE_BINMODE
The IO is in "binary mode".
Definition io.h:268
#define FMODE_SYNC
The IO is in "sync mode".
Definition io.h:275
#define FMODE_TEXTMODE
The IO is in "text mode".
Definition io.h:332
#define FMODE_TRUNC
This flag amends the effect of FMODE_CREATE, so that if there already is a file at the given path it ...
Definition io.h:318
void ruby_each_words(const char *str, void(*func)(const char *word, int len, void *argv), void *argv)
Scans the passed string, with calling the callback function every time it encounters a "word".
VALUE type(ANYARGS)
ANYARGS-ed function type.
ruby_rarray_consts
This is an enum because GDB wants it (rather than a macro).
Definition rarray.h:163
ruby_robject_consts
This is an enum because GDB wants it (rather than a macro).
Definition robject.h:82
ruby_rstring_consts
This is an enum because GDB wants it (rather than a macro).
Definition rstring.h:210
ruby_special_consts
special constants - i.e.
Definition debug.c:32
Definition node.h:156
void rb_nativethread_lock_lock(rb_nativethread_lock_t *lock)
Blocks until the current thread obtains a lock.
Definition thread.c:299
void rb_nativethread_lock_unlock(rb_nativethread_lock_t *lock)
Releases a lock.
Definition thread.c:305
void rb_nativethread_lock_initialize(rb_nativethread_lock_t *lock)
Fills the passed lock with an initial value.
Definition thread.c:287
intptr_t SIGNED_VALUE
A signed integer type that has the same width with VALUE.
Definition value.h:63
uintptr_t VALUE
Type that represents a Ruby object.
Definition value.h:40
uintptr_t ID
Type that represents a Ruby identifier such as a variable name.
Definition value.h:52
ruby_value_type
C-level type of an object.
Definition value_type.h:112