[Feature #20265] Remove rb_newobj and RB_NEWOBJ
This commit is contained in:
parent
161545d55d
commit
8e1831406f
8
gc.c
8
gc.c
@ -2952,14 +2952,6 @@ rb_wb_protected_newobj_of(rb_execution_context_t *ec, VALUE klass, VALUE flags,
|
|||||||
return newobj_of(rb_ec_ractor_ptr(ec), klass, flags, 0, 0, 0, TRUE, size);
|
return newobj_of(rb_ec_ractor_ptr(ec), klass, flags, 0, 0, 0, TRUE, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* for compatibility */
|
|
||||||
|
|
||||||
VALUE
|
|
||||||
rb_newobj(void)
|
|
||||||
{
|
|
||||||
return newobj_of(GET_RACTOR(), 0, T_NONE, 0, 0, 0, FALSE, RVALUE_SIZE);
|
|
||||||
}
|
|
||||||
|
|
||||||
VALUE
|
VALUE
|
||||||
rb_newobj_of(VALUE klass, VALUE flags)
|
rb_newobj_of(VALUE klass, VALUE flags)
|
||||||
{
|
{
|
||||||
|
@ -29,21 +29,6 @@
|
|||||||
#include "ruby/internal/value.h"
|
#include "ruby/internal/value.h"
|
||||||
#include "ruby/assert.h"
|
#include "ruby/assert.h"
|
||||||
|
|
||||||
/**
|
|
||||||
* Declares, allocates, then assigns a new object to the given variable.
|
|
||||||
*
|
|
||||||
* @param obj Variable name.
|
|
||||||
* @param type Variable type.
|
|
||||||
* @exception rb_eNoMemError No space left.
|
|
||||||
* @return An allocated object, not initialised.
|
|
||||||
* @note Modern programs tend to use #NEWOBJ_OF instead.
|
|
||||||
*
|
|
||||||
* @internal
|
|
||||||
*
|
|
||||||
* :FIXME: Should we deprecate it?
|
|
||||||
*/
|
|
||||||
#define RB_NEWOBJ(obj,type) type *(obj) = RBIMPL_CAST((type *)rb_newobj())
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Identical to #RB_NEWOBJ, except it also accepts the allocating object's
|
* Identical to #RB_NEWOBJ, except it also accepts the allocating object's
|
||||||
* class and flags.
|
* class and flags.
|
||||||
@ -57,20 +42,12 @@
|
|||||||
*/
|
*/
|
||||||
#define RB_NEWOBJ_OF(obj,type,klass,flags) type *(obj) = RBIMPL_CAST((type *)rb_newobj_of(klass, flags))
|
#define RB_NEWOBJ_OF(obj,type,klass,flags) type *(obj) = RBIMPL_CAST((type *)rb_newobj_of(klass, flags))
|
||||||
|
|
||||||
#define NEWOBJ RB_NEWOBJ /**< @old{RB_NEWOBJ} */
|
|
||||||
#define NEWOBJ_OF RB_NEWOBJ_OF /**< @old{RB_NEWOBJ_OF} */
|
#define NEWOBJ_OF RB_NEWOBJ_OF /**< @old{RB_NEWOBJ_OF} */
|
||||||
#define OBJSETUP rb_obj_setup /**< @old{rb_obj_setup} */
|
#define OBJSETUP rb_obj_setup /**< @old{rb_obj_setup} */
|
||||||
#define CLONESETUP rb_clone_setup /**< @old{rb_clone_setup} */
|
#define CLONESETUP rb_clone_setup /**< @old{rb_clone_setup} */
|
||||||
#define DUPSETUP rb_dup_setup /**< @old{rb_dup_setup} */
|
#define DUPSETUP rb_dup_setup /**< @old{rb_dup_setup} */
|
||||||
|
|
||||||
RBIMPL_SYMBOL_EXPORT_BEGIN()
|
RBIMPL_SYMBOL_EXPORT_BEGIN()
|
||||||
/**
|
|
||||||
* This is the implementation detail of #RB_NEWOBJ.
|
|
||||||
*
|
|
||||||
* @exception rb_eNoMemError No space left.
|
|
||||||
* @return An allocated object, not initialised.
|
|
||||||
*/
|
|
||||||
VALUE rb_newobj(void);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the implementation detail of #RB_NEWOBJ_OF.
|
* This is the implementation detail of #RB_NEWOBJ_OF.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user