Permalink
Browse files

* include/ruby/ruby.h: add a comment for WB interfaces.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
1 parent b0381a4 commit b766cc4e70f18ab1b3be5aef35d2af8817d23714 @ko1 ko1 committed Dec 20, 2013
Showing with 15 additions and 0 deletions.
  1. +4 −0 ChangeLog
  2. +11 −0 include/ruby/ruby.h
View
@@ -1,3 +1,7 @@
+Fri Dec 20 16:01:35 2013 Koichi Sasada <ko1@atdot.net>
+
+ * include/ruby/ruby.h: add a comment for WB interfaces.
+
Fri Dec 20 16:00:52 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in: DLDFLAGS is defined in --with-opt-dir handler, so
View
@@ -1199,6 +1199,17 @@ void rb_gc_writebarrier_unprotect_promoted(VALUE obj);
#define OBJ_WB_UNPROTECT(x) rb_obj_wb_unprotect(x, __FILE__, __LINE__)
#endif
+/* 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__)

0 comments on commit b766cc4

Please sign in to comment.