Ruby  3.4.0dev (2024-11-22 revision 37a72b0150ec36b4ea27175039afc28c62207b0c)
Data Structures | Macros | Enumerations | Functions
rbasic.h File Reference

(37a72b0150ec36b4ea27175039afc28c62207b0c)

Defines struct RBasic. More...

#include "ruby/internal/attr/artificial.h"
#include "ruby/internal/attr/constexpr.h"
#include "ruby/internal/attr/forceinline.h"
#include "ruby/internal/attr/noalias.h"
#include "ruby/internal/attr/pure.h"
#include "ruby/internal/cast.h"
#include "ruby/internal/dllexport.h"
#include "ruby/internal/special_consts.h"
#include "ruby/internal/value.h"
#include "ruby/assert.h"
Include dependency graph for rbasic.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  RBasic
 Ruby object's base components. More...
 

Macros

#define RBASIC(obj)   RBIMPL_CAST((struct RBasic *)(obj))
 Convenient casting macro. More...
 

Enumerations

enum  ruby_rvalue_flags { RVALUE_EMBED_LEN_MAX = RBIMPL_RVALUE_EMBED_LEN_MAX }
 This is an enum because GDB wants it (rather than a macro). More...
 

Functions

VALUE rb_obj_hide (VALUE obj)
 Make the object invisible from Ruby code. More...
 
VALUE rb_obj_reveal (VALUE obj, VALUE klass)
 Make a hidden object visible again. More...
 
static VALUE RBASIC_CLASS (VALUE obj)
 Queries the class of an object. More...
 

Detailed Description

Defines struct RBasic.

Author
Ruby developers ruby-.nosp@m.core.nosp@m.@ruby.nosp@m.-lan.nosp@m.g.org
Warning
Symbols prefixed with either RBIMPL or rbimpl are implementation details. Don't take them as canon. They could rapidly appear then vanish. The name (path) of this header file is also an implementation detail. Do not expect it to persist at the place it is now. Developers are free to move it anywhere anytime at will.
Note
To ruby-core: remember that this header can be possibly recursively included from extension libraries written in C++. Do not expect for instance __VA_ARGS__ is always available. We assume C99 for ruby itself but we don't assume languages of extension libraries. They could be written in C++98.

Definition in file rbasic.h.

Macro Definition Documentation

◆ RBASIC

#define RBASIC (   obj)    RBIMPL_CAST((struct RBasic *)(obj))

Convenient casting macro.

Parameters
objArbitrary Ruby object.
Returns
The passed object casted to RBasic.

Definition at line 40 of file rbasic.h.

Enumeration Type Documentation

◆ ruby_rvalue_flags

This is an enum because GDB wants it (rather than a macro).

People need not bother.

Enumerator
RVALUE_EMBED_LEN_MAX 

Max possible number of objects that can be embedded.

Definition at line 53 of file rbasic.h.

Function Documentation

◆ RBASIC_CLASS()

static VALUE RBASIC_CLASS ( VALUE  obj)
inlinestatic

Queries the class of an object.

Parameters
[in]objAn object.
Returns
Its class.

Definition at line 150 of file rbasic.h.

Referenced by rb_class_of(), rb_freeze_singleton_class(), and rb_obj_freeze_inline().