path: root/include
diff options
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-20 07:01:52 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-12-20 07:01:52 +0000
commitb766cc4e70f18ab1b3be5aef35d2af8817d23714 (patch)
tree43a576789a9dd69eba4bf91544255abff5f3ef40 /include
parentb0381a4b1f59bb2815393145be001cc239fc541e (diff)
* include/ruby/ruby.h: add a comment for WB interfaces.
git-svn-id: svn+ssh:// b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include')
1 files changed, 11 insertions, 0 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index 03b9bd0..366ce96 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -1199,6 +1199,17 @@ void rb_gc_writebarrier_unprotect_promoted(VALUE obj);
#define OBJ_WB_UNPROTECT(x) rb_obj_wb_unprotect(x, __FILE__, __LINE__)
+/* Write barrier (WB) interfaces:
+ * - OBJ_WRITE(a, slot, b): WB for new reference from `a' to `b'.
+ * Write `b' into `*slot'. `slot' is a pointer in `a'.
+ * - OBJ_WRITTEN(a, oldv, b): WB for new reference from `a' to `b'.
+ * This doesn't write any values, but only a WB declaration.
+ * `oldv' is replaced value with `b' (not used in current Ruby).
+ *
+ * NOTE: The following core interfaces can be changed in the future.
+ * Please catch up if you want to insert WB into C-extensions
+ * correctly.
+ */
#define OBJ_WRITE(a, slot, b) rb_obj_write((VALUE)(a), (VALUE *)(slot), (VALUE)(b), __FILE__, __LINE__)
#define OBJ_WRITTEN(a, oldv, b) rb_obj_written((VALUE)(a), (VALUE)(oldv), (VALUE)(b), __FILE__, __LINE__)