Ruby  3.4.0dev (2024-12-06 revision 892c46283a5ea4179500d951c9d4866c0051f27b)
Macros
Write barrier (WB) interfaces:

Macros

#define RB_OBJ_WRITE(old, slot, young)    RBIMPL_CAST(rb_obj_write((VALUE)(old), (VALUE *)(slot), (VALUE)(young), __FILE__, __LINE__))
 Declaration of a "back" pointer. More...
 
#define RB_OBJ_WRITTEN(old, oldv, young)    RBIMPL_CAST(rb_obj_written((VALUE)(old), (VALUE)(oldv), (VALUE)(young), __FILE__, __LINE__))
 Identical to RB_OBJ_WRITE(), except it doesn't write any values, but only a WB declaration. More...
 

Detailed Description

Note
The following core interfaces can be changed in the future. Please catch up if you want to insert WB into C-extensions correctly.

Macro Definition Documentation

◆ RB_OBJ_WRITE

#define RB_OBJ_WRITE (   old,
  slot,
  young 
)     RBIMPL_CAST(rb_obj_write((VALUE)(old), (VALUE *)(slot), (VALUE)(young), __FILE__, __LINE__))

Declaration of a "back" pointer.

This is a write barrier for new reference from "old" generation to "young" generation. It writes young into *slot, which is a pointer inside of old.

Parameters
[in]oldAn old object.
[in]slotA pointer inside of old.
[out]youngA young object.

Definition at line 603 of file gc.h.

◆ RB_OBJ_WRITTEN

#define RB_OBJ_WRITTEN (   old,
  oldv,
  young 
)     RBIMPL_CAST(rb_obj_written((VALUE)(old), (VALUE)(oldv), (VALUE)(young), __FILE__, __LINE__))

Identical to RB_OBJ_WRITE(), except it doesn't write any values, but only a WB declaration.

oldv is replaced value with b (not used in current Ruby).

Parameters
[in]oldAn old object.
[in]oldvAn object previously stored inside of old.
[out]youngA young object.

Definition at line 615 of file gc.h.