dest
is always embedded so we can remove this check
This commit is contained in:
parent
fb3c711df3
commit
0bbbb5a657
Notes:
git
2020-10-29 00:42:22 +09:00
9
object.c
9
object.c
@ -36,6 +36,7 @@
|
|||||||
#include "ruby/encoding.h"
|
#include "ruby/encoding.h"
|
||||||
#include "ruby/st.h"
|
#include "ruby/st.h"
|
||||||
#include "ruby/util.h"
|
#include "ruby/util.h"
|
||||||
|
#include "ruby/assert.h"
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -324,12 +325,8 @@ rb_obj_singleton_class(VALUE obj)
|
|||||||
MJIT_FUNC_EXPORTED void
|
MJIT_FUNC_EXPORTED void
|
||||||
rb_obj_copy_ivar(VALUE dest, VALUE obj)
|
rb_obj_copy_ivar(VALUE dest, VALUE obj)
|
||||||
{
|
{
|
||||||
if (!(RBASIC(dest)->flags & ROBJECT_EMBED) && ROBJECT_IVPTR(dest)) {
|
RUBY_ASSERT(RBASIC(dest)->flags & ROBJECT_EMBED);
|
||||||
xfree(ROBJECT_IVPTR(dest));
|
|
||||||
ROBJECT(dest)->as.heap.ivptr = 0;
|
|
||||||
ROBJECT(dest)->as.heap.numiv = 0;
|
|
||||||
ROBJECT(dest)->as.heap.iv_index_tbl = 0;
|
|
||||||
}
|
|
||||||
if (RBASIC(obj)->flags & ROBJECT_EMBED) {
|
if (RBASIC(obj)->flags & ROBJECT_EMBED) {
|
||||||
MEMCPY(ROBJECT(dest)->as.ary, ROBJECT(obj)->as.ary, VALUE, ROBJECT_EMBED_LEN_MAX);
|
MEMCPY(ROBJECT(dest)->as.ary, ROBJECT(obj)->as.ary, VALUE, ROBJECT_EMBED_LEN_MAX);
|
||||||
RBASIC(dest)->flags |= ROBJECT_EMBED;
|
RBASIC(dest)->flags |= ROBJECT_EMBED;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user