aboutsummaryrefslogtreecommitdiffstats
path: root/eval_intern.h
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2019-05-31 15:58:50 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2019-05-31 16:04:16 +0900
commitb1aecef87364631b0001dd2aafc432931e19a98f (patch)
tree7132db2022addc42126a1992c312eb7566dd2df6 /eval_intern.h
parentea42423908ed055f9039b1dce6e9a232a3b2dd90 (diff)
downloadruby-b1aecef87364631b0001dd2aafc432931e19a98f.tar.gz
Use UNALIGNED_MEMBER_PTR
* internal.h (UNALIGNED_MEMBER_ACCESS, UNALIGNED_MEMBER_PTR): moved from eval_intern.h. * compile.c iseq.c, vm.c: use UNALIGNED_MEMBER_PTR for `entries` in `struct iseq_catch_table`. * vm_eval.c, vm_insnhelper.c: use UNALIGNED_MEMBER_PTR for `body` in `rb_method_definition_t`.
Diffstat (limited to 'eval_intern.h')
-rw-r--r--eval_intern.h17
1 files changed, 0 insertions, 17 deletions
diff --git a/eval_intern.h b/eval_intern.h
index ad74408ff7..db28aa1598 100644
--- a/eval_intern.h
+++ b/eval_intern.h
@@ -157,23 +157,6 @@ LONG WINAPI rb_w32_stack_overflow_handler(struct _EXCEPTION_POINTERS *);
# define VAR_NOCLOBBERED(var) var
#endif
-#if defined(USE_UNALIGNED_MEMBER_ACCESS) && USE_UNALIGNED_MEMBER_ACCESS && \
- (defined(__clang__) || GCC_VERSION_SINCE(9, 0, 0))
-# define UNALIGNED_MEMBER_ACCESS(expr) __extension__({ \
- COMPILER_WARNING_PUSH; \
- COMPILER_WARNING_IGNORED(-Waddress-of-packed-member); \
- typeof(expr) unaligned_member_access_result = (expr); \
- COMPILER_WARNING_POP; \
- unaligned_member_access_result; \
-})
-#else
-# define UNALIGNED_MEMBER_ACCESS(expr) expr
-#endif
-#define UNALIGNED_MEMBER_PTR(ptr, mem) UNALIGNED_MEMBER_ACCESS(&(ptr)->mem)
-
-#undef RB_OBJ_WRITE
-#define RB_OBJ_WRITE(a, slot, b) UNALIGNED_MEMBER_ACCESS(rb_obj_write((VALUE)(a), (VALUE *)(slot), (VALUE)(b), __FILE__, __LINE__))
-
/* clear ec->tag->state, and return the value */
static inline int
rb_ec_tag_state(const rb_execution_context_t *ec)