Ruby  3.4.0dev (2024-11-22 revision 0989400a925cd201defdca9eb28eb87200b30785)
newobj.h
Go to the documentation of this file.
1 #ifndef RBIMPL_NEWOBJ_H /*-*-C++-*-vi:se ft=cpp:*/
2 #define RBIMPL_NEWOBJ_H
24 #include "ruby/internal/cast.h"
27 #include "ruby/internal/fl_type.h"
29 #include "ruby/internal/value.h"
30 #include "ruby/assert.h"
31 
32 #define OBJSETUP rb_obj_setup
33 #define CLONESETUP rb_clone_setup
34 #define DUPSETUP rb_dup_setup
57 VALUE rb_obj_setup(VALUE obj, VALUE klass, VALUE type);
58 
68 
83 
96 void rb_singleton_class_attached(VALUE klass, VALUE obj);
97 
109 void rb_copy_generic_ivar(VALUE clone, VALUE obj);
111 
112 RBIMPL_ATTR_DEPRECATED(("This is no longer how Object#clone works."))
123 static inline void
124 rb_clone_setup(VALUE clone, VALUE obj)
125 {
126  (void)clone;
127  (void)obj;
128  return;
129 }
130 
131 RBIMPL_ATTR_DEPRECATED(("This is no longer how Object#dup works."))
142 static inline void
143 rb_dup_setup(VALUE dup, VALUE obj)
144 {
145  (void)dup;
146  (void)obj;
147  return;
148 }
149 
150 #endif /* RBIMPL_NEWOBJ_H */
Defines RBIMPL_ATTR_DEPRECATED.
#define RBIMPL_ATTR_DEPRECATED(msg)
Wraps (or simulates) [[deprecated]]
Definition: deprecated.h:36
Tweaking visibility of C variables/functions.
#define RBIMPL_SYMBOL_EXPORT_END()
Counterpart of RBIMPL_SYMBOL_EXPORT_BEGIN.
Definition: dllexport.h:74
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition: dllexport.h:65
Defines enum ruby_fl_type.
VALUE rb_singleton_class_clone(VALUE obj)
Clones a singleton class.
Definition: class.c:645
void rb_singleton_class_attached(VALUE klass, VALUE obj)
Attaches a singleton class to its corresponding object.
Definition: class.c:709
VALUE rb_obj_class(VALUE obj)
Queries the class of an object.
Definition: object.c:247
VALUE rb_obj_setup(VALUE obj, VALUE klass, VALUE type)
Fills common fields in the object.
Definition: object.c:152
VALUE type(ANYARGS)
ANYARGS-ed function type.
Definition: cxxanyargs.hpp:56
void rb_copy_generic_ivar(VALUE clone, VALUE obj)
Copies the list of instance variables.
Definition: variable.c:2036
Defines struct RBasic.
Defines enum ruby_special_consts.
Defines VALUE and ID.
uintptr_t VALUE
Type that represents a Ruby object.
Definition: value.h:40