Ruby: internal.h File Reference

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

Macros | Functions
internal.h File Reference
`#include "ruby/internal/config.h"`
`#include "ruby/ruby.h"`

Go to the source code of this file.

## Macros
#define | LIKELY(x) RB_LIKELY(x)
#define | UNLIKELY(x) RB_UNLIKELY(x)
#define | numberof(array) ((int)(sizeof(array) / sizeof((array)[0])))
#define | roomof(x, y) (((x) + (y) - 1) / (y))
#define | type_roomof(x, y) roomof(sizeof(x), sizeof(y))
#define | ACCESS_ONCE(type, x) (*((volatile type *)&(x)))
#define | rb_ary_new_from_args(...) rb_nonexistent_symbol(__VA_ARGS__)
#define | rb_io_fptr_finalize(...) rb_nonexistent_symbol(__VA_ARGS__)
#define | rb_fstring_cstr(...) rb_nonexistent_symbol(__VA_ARGS__)
#define | rb_sym_intern_ascii_cstr(...) rb_nonexistent_symbol(__VA_ARGS__)
#define | rb_funcallv(...) rb_nonexistent_symbol(__VA_ARGS__)
#define | rb_method_basic_definition_p(...) rb_nonexistent_symbol(__VA_ARGS__)
#define | rp(obj) rb_obj_info_dump_loc((VALUE)(obj), __FILE__, __LINE__, RUBY_FUNCTION_NAME_STRING)
#define | rp_m(msg, obj)
#define | bp() ruby_debug_breakpoint()

## Functions
void | rb_obj_info_dump (VALUE obj)
void | rb_obj_info_dump_loc (VALUE obj, const char *file, int line, const char *func)
void | ruby_debug_breakpoint (void)
void | ruby_debug_printf (const char *,...)

## Detailed Description

Author
  $Author$

Date
  Tue May 17 11:42:20 JST 2011

Copyright
  Copyright (C) 2011 Yukihiro Matsumoto
  This file is a part of the programming language Ruby. Permission is hereby granted, to either redistribute and/or modify this file, provided that the conditions mentioned in the file COPYING are met. Consult the file for details.

Definition in file internal.h.

## Macro Definition Documentation

## ◆ ACCESS_ONCE

#define ACCESS_ONCE | ( |  | type,
|  |  | x
| ) |  | (*((volatile type *)&(x)))

Definition at line 27 of file internal.h.

## ◆ bp

#define bp | ( |  | ) | ruby_debug_breakpoint()

Definition at line 105 of file internal.h.

## ◆ LIKELY

#define LIKELY | ( |  | x | ) | RB_LIKELY(x)

Definition at line 19 of file internal.h.

## ◆ numberof

#define numberof | ( |  | array | ) | ((int)(sizeof(array) / sizeof((array)[0])))

Definition at line 22 of file internal.h.

## ◆ rb_ary_new_from_args

#define rb_ary_new_from_args | ( |  | ... | ) | rb_nonexistent_symbol(__VA_ARGS__)

Definition at line 65 of file internal.h.

## ◆ rb_fstring_cstr

#define rb_fstring_cstr | ( |  | ... | ) | rb_nonexistent_symbol(__VA_ARGS__)

Definition at line 71 of file internal.h.

## ◆ rb_funcallv

#define rb_funcallv | ( |  | ... | ) | rb_nonexistent_symbol(__VA_ARGS__)

Definition at line 77 of file internal.h.

## ◆ rb_io_fptr_finalize

#define rb_io_fptr_finalize | ( |  | ... | ) | rb_nonexistent_symbol(__VA_ARGS__)

Definition at line 68 of file internal.h.

## ◆ rb_method_basic_definition_p

#define rb_method_basic_definition_p | ( |  | ... | ) | rb_nonexistent_symbol(__VA_ARGS__)

Definition at line 78 of file internal.h.

## ◆ rb_sym_intern_ascii_cstr

#define rb_sym_intern_ascii_cstr | ( |  | ... | ) | rb_nonexistent_symbol(__VA_ARGS__)

Definition at line 74 of file internal.h.

## ◆ roomof

#define roomof | ( |  | x,
|  |  | y
| ) |  | (((x) + (y) - 1) / (y))

Definition at line 23 of file internal.h.

## ◆ rp

#define rp | ( |  | obj | ) | rb_obj_info_dump_loc((VALUE)(obj), __FILE__, __LINE__, RUBY_FUNCTION_NAME_STRING)

Definition at line 95 of file internal.h.

## ◆ rp_m

#define rp_m | ( |  | msg,
|  |  | obj
| ) |  |

Value:
do { \
fprintf(stderr, "%s", (msg)); \
rb_obj_info_dump((VALUE)obj); \
} while (0)
VALUE
unsigned long VALUE
Definition: value.h:38

Definition at line 98 of file internal.h.

## ◆ type_roomof

#define type_roomof | ( |  | x,
|  |  | y
| ) |  | roomof(sizeof(x), sizeof(y))

Definition at line 24 of file internal.h.

## ◆ UNLIKELY

#define UNLIKELY | ( |  | x | ) | RB_UNLIKELY(x)

Definition at line 20 of file internal.h.

## Function Documentation

## ◆ rb_obj_info_dump()

void rb_obj_info_dump | ( | VALUE | obj | ) |

Definition at line 12505 of file gc.c.

References rb_raw_obj_info().

## ◆ rb_obj_info_dump_loc()

void rb_obj_info_dump_loc | ( | VALUE | obj,
|  | const char * | file,
|  | int | line,
|  | const char * | func
| ) |  |

Definition at line 12512 of file gc.c.

References rb_raw_obj_info().

## ◆ ruby_debug_breakpoint()

void ruby_debug_breakpoint | ( | void |  | ) |

Definition at line 158 of file debug.c.

## ◆ ruby_debug_printf()

void ruby_debug_printf | ( | const char * | format,
|  |  | ...
| ) |  |

Definition at line 108 of file debug.c.