1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

RB_EC_NEWOBJ_OF

NEWOBJ with current ec.
This commit is contained in:
Koichi Sasada 2020-12-06 15:40:16 +09:00
parent 91d99025e4
commit 59ddb88da6
Notes: git 2020-12-07 08:29:08 +09:00
2 changed files with 8 additions and 1 deletions

2
gc.c
View file

@ -2335,7 +2335,7 @@ rb_wb_protected_newobj_of(VALUE klass, VALUE flags)
}
VALUE
rb_wb_protected_newobj_of_ec(rb_execution_context_t *ec, VALUE klass, VALUE flags)
rb_ec_wb_protected_newobj_of(rb_execution_context_t *ec, VALUE klass, VALUE flags)
{
GC_ASSERT((flags & FL_WB_PROTECTED) == 0);
return newobj_of_cr(rb_ec_ractor_ptr(ec), klass, flags, 0, 0, 0, TRUE);

View file

@ -30,6 +30,12 @@ struct rb_objspace; /* in vm_core.h */
T *(var) = (T *)(((f) & FL_WB_PROTECTED) ? \
rb_wb_protected_newobj_of((c), (f) & ~FL_WB_PROTECTED) : \
rb_wb_unprotected_newobj_of((c), (f)))
#define RB_EC_NEWOBJ_OF(ec, var, T, c, f) \
T *(var) = (T *)(((f) & FL_WB_PROTECTED) ? \
rb_ec_wb_protected_newobj_of((ec), (c), (f) & ~FL_WB_PROTECTED) : \
rb_wb_unprotected_newobj_of((c), (f)))
#define NEWOBJ_OF(var, T, c, f) RB_NEWOBJ_OF((var), T, (c), (f))
#define RB_OBJ_GC_FLAGS_MAX 6 /* used in ext/objspace */
@ -85,6 +91,7 @@ RUBY_SYMBOL_EXPORT_BEGIN
const char *rb_objspace_data_type_name(VALUE obj);
VALUE rb_wb_protected_newobj_of(VALUE, VALUE);
VALUE rb_wb_unprotected_newobj_of(VALUE, VALUE);
VALUE rb_ec_wb_protected_newobj_of(struct rb_execution_context_struct *ec, VALUE klass, VALUE flags);
size_t rb_obj_memsize_of(VALUE);
void rb_gc_verify_internal_consistency(void);
size_t rb_obj_gc_flags(VALUE, ID[], size_t);