summaryrefslogtreecommitdiff
path: root/internal/gc.h
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2023-02-03 14:23:00 -0500
committerPeter Zhu <peter@peterzhu.ca>2023-02-07 16:03:08 -0500
commit1c0127ed5e1aaf1386e2176e499d4cb25d171a21 (patch)
tree820dc7f4d9a106e36ecbacd8c3a42a5d7630b8c8 /internal/gc.h
parente9090eb64db703f27be6efbdd4f371822c96146c (diff)
downloadruby-1c0127ed5e1aaf1386e2176e499d4cb25d171a21.tar.gz
Make Time objects WB protected
Co-Authored-By: Jean Boussier <byroot@ruby-lang.org>
Diffstat (limited to 'internal/gc.h')
-rw-r--r--internal/gc.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/gc.h b/internal/gc.h
index f380086b44..8fb219a0c4 100644
--- a/internal/gc.h
+++ b/internal/gc.h
@@ -73,6 +73,11 @@ struct rb_objspace; /* in vm_core.h */
# define UNALIGNED_MEMBER_PTR(ptr, mem) UNALIGNED_MEMBER_ACCESS(&(ptr)->mem)
#endif
+#define RB_OBJ_WRITE_UNALIGNED(old, slot, young) do { \
+ VALUE *_slot = UNALIGNED_MEMBER_ACCESS(slot); \
+ RB_OBJ_WRITE(old, _slot, young); \
+} while (0)
+
// We use SIZE_POOL_COUNT number of shape IDs for transitions out of different size pools
// The next available shape ID will be the SPECIAL_CONST_SHAPE_ID
#if USE_RVARGC && (SIZEOF_UINT64_T == SIZEOF_VALUE)