Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)
|
#include "ruby/internal/cast.h"
#include "ruby/internal/core/rbasic.h"
#include "ruby/internal/dllexport.h"
#include "ruby/internal/fl_type.h"
#include "ruby/internal/special_consts.h"
#include "ruby/internal/value.h"
#include "ruby/assert.h"
Go to the source code of this file.
Macros | |
#define | RB_NEWOBJ(obj, type) type *(obj) = RBIMPL_CAST((type *)rb_newobj()) |
#define | RB_NEWOBJ_OF(obj, type, klass, flags) type *(obj) = RBIMPL_CAST((type *)rb_newobj_of(klass, flags)) |
#define | NEWOBJ RB_NEWOBJ |
#define | NEWOBJ_OF RB_NEWOBJ_OF /* core has special NEWOBJ_OF() in internal.h */ |
#define | OBJSETUP rb_obj_setup /* use NEWOBJ_OF instead of NEWOBJ()+OBJSETUP() */ |
#define | CLONESETUP rb_clone_setup |
#define | DUPSETUP rb_dup_setup |
Functions | |
VALUE | rb_newobj (void) |
VALUE | rb_newobj_of (VALUE, VALUE) |
VALUE | rb_obj_setup (VALUE obj, VALUE klass, VALUE type) |
Fills common (RBasic ) fields in obj. More... | |
VALUE | rb_obj_class (VALUE) |
VALUE | rb_singleton_class_clone (VALUE) |
void | rb_singleton_class_attached (VALUE, VALUE) |
Attach a object to a singleton class. More... | |
void | rb_copy_generic_ivar (VALUE, VALUE) |
Defines NEWOBJ.
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. __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 newobj.h.
#define NEWOBJ_OF RB_NEWOBJ_OF /* core has special NEWOBJ_OF() in internal.h */ |
#define OBJSETUP rb_obj_setup /* use NEWOBJ_OF instead of NEWOBJ()+OBJSETUP() */ |
#define RB_NEWOBJ | ( | obj, | |
type | |||
) | type *(obj) = RBIMPL_CAST((type *)rb_newobj()) |
#define RB_NEWOBJ_OF | ( | obj, | |
type, | |||
klass, | |||
flags | |||
) | type *(obj) = RBIMPL_CAST((type *)rb_newobj_of(klass, flags)) |
Definition at line 1638 of file variable.c.
Definition at line 2371 of file gc.c.
References FL_WB_PROTECTED, heap_page::flags, Qundef, ROBJECT_EMBED, RUBY_T_MASK, and T_OBJECT.