Ruby
3.4.0dev (2024-12-06 revision 892c46283a5ea4179500d951c9d4866c0051f27b)
|
Defines #NEWOBJ. More...
#include "ruby/internal/attr/deprecated.h"
#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 | OBJSETUP rb_obj_setup |
Old name of rb_obj_setup. More... | |
#define | CLONESETUP rb_clone_setup |
Old name of rb_clone_setup. More... | |
#define | DUPSETUP rb_dup_setup |
Old name of rb_dup_setup. More... | |
Functions | |
VALUE | rb_obj_setup (VALUE obj, VALUE klass, VALUE type) |
Fills common fields in the object. More... | |
VALUE | rb_obj_class (VALUE obj) |
Queries the class of an object. More... | |
VALUE | rb_singleton_class_clone (VALUE obj) |
Clones a singleton class. More... | |
void | rb_singleton_class_attached (VALUE klass, VALUE obj) |
Attaches a singleton class to its corresponding object. More... | |
void | rb_copy_generic_ivar (VALUE clone, VALUE obj) |
Copies the list of instance variables. More... | |
static void | rb_clone_setup (VALUE clone, VALUE obj) |
static void | rb_dup_setup (VALUE dup, VALUE obj) |
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.
Object#clone
stopped using this function.It remained untouched for a while, and then @shyouhei realised that they are no longer doing the same thing. It seems nobody seriously uses this function any longer. Let's just abandon it.
[out] | clone | The destination object. |
[in] | obj | The source object. |
Copies the list of instance variables.
3rd parties need not know, but there are several ways to store an object's instance variables, depending on its internal structure. This function makes sense when either of the passed objects are using so-called "generic" backend storage. This distinction is purely an implementation detail of rb_clone_setup(). People need not be aware of this working behind-the-scenes.
[out] | clone | The destination object. |
[in] | obj | The source object. |
Definition at line 2048 of file variable.c.
Referenced by rb_hash_dup().
Object#dup
stopped using this function.It remained untouched for a while, and then @shyouhei realised that they are no longer the same thing. It seems nobody seriously uses this function any longer. Let's just abandon it.
[out] | dup | The destination object. |
[in] | obj | The source object. |