summaryrefslogtreecommitdiff
path: root/include/ruby/ruby.h
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-15 04:36:09 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-15 04:36:09 +0000
commite41b4a45a4372167adf4717e7d5e87e29b352227 (patch)
tree68543da8958a3cf2bf83afbd345c124b65044d0b /include/ruby/ruby.h
parentbca40b8b56bdfb31a791ec809a5054c016d90feb (diff)
give up RSTRING_PTR() being VALUE-aligned
rb_setup_fake_str() can take arbitrary char* address, typicalluy C string literals. These arguments have no guarantee of alignment at all. It was not a wise idea for me to think RSTRING_PTR can be aligned. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include/ruby/ruby.h')
-rw-r--r--include/ruby/ruby.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index 1e1edc26bd..df98c0daa8 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -957,13 +957,13 @@ struct RString {
union {
struct {
long len;
- ruby_aligned_char *ptr;
+ char *ptr;
union {
long capa;
VALUE shared;
} aux;
} heap;
- char RUBY_ALIGNAS(SIZEOF_VALUE) ary[RSTRING_EMBED_LEN_MAX + 1];
+ char ary[RSTRING_EMBED_LEN_MAX + 1];
} as;
};
#define RSTRING_EMBED_LEN(str) \
@@ -975,7 +975,7 @@ struct RString {
RSTRING(str)->as.heap.len)
#define RSTRING_PTR(str) \
(!(RBASIC(str)->flags & RSTRING_NOEMBED) ? \
- (ruby_aligned_char *)RSTRING(str)->as.ary : \
+ RSTRING(str)->as.ary : \
RSTRING(str)->as.heap.ptr)
#define RSTRING_END(str) \
(!(RBASIC(str)->flags & RSTRING_NOEMBED) ? \