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:
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
2
gc.c
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue