[前][次][番号順一覧][スレッド一覧]

ruby-changes:49716

From: shyouhei <ko1@a...>
Date: Mon, 15 Jan 2018 11:59:23 +0900 (JST)
Subject: [ruby-changes:49716] shyouhei:r61833 (trunk): __declspec(align(#)) does not take sizeof()

shyouhei	2018-01-15 11:59:18 +0900 (Mon, 15 Jan 2018)

  New Revision: 61833

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=61833

  Log:
    __declspec(align(#)) does not take sizeof()
    
    Use compile-time constant expression instead.

  Modified files:
    trunk/compile.c
    trunk/include/ruby/ruby.h
Index: compile.c
===================================================================
--- compile.c	(revision 61832)
+++ compile.c	(revision 61833)
@@ -8077,7 +8077,7 @@ struct ibf_dump { https://github.com/ruby/ruby/blob/trunk/compile.c#L8077
 rb_iseq_t * iseq_alloc(void);
 
 struct ibf_load {
-    const RUBY_ALIGNAS(sizeof(VALUE)) char *buff;
+    const ruby_aligned_char *buff;
     const struct ibf_header *header;
     ID *id_list;     /* [id0, ...] */
     VALUE iseq_list; /* [iseq0, ...] */
Index: include/ruby/ruby.h
===================================================================
--- include/ruby/ruby.h	(revision 61832)
+++ include/ruby/ruby.h	(revision 61833)
@@ -853,7 +853,7 @@ enum ruby_fl_type { https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L853
     RUBY_FL_SINGLETON = RUBY_FL_USER0
 };
 
-struct RUBY_ALIGNAS(sizeof(VALUE)) RBasic {
+struct RUBY_ALIGNAS(SIZEOF_VALUE) RBasic {
     VALUE flags;
     const VALUE klass;
 };
@@ -950,7 +950,7 @@ enum ruby_rstring_flags { https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L950
     RSTRING_ENUM_END
 };
 
-typedef RUBY_ALIGNAS(sizeof(VALUE)) char ruby_aligned_char;
+typedef RUBY_ALIGNAS(SIZEOF_VALUE) char ruby_aligned_char;
 
 struct RString {
     struct RBasic basic;
@@ -963,7 +963,7 @@ struct RString { https://github.com/ruby/ruby/blob/trunk/include/ruby/ruby.h#L963
 		VALUE shared;
 	    } aux;
 	} heap;
-	char RUBY_ALIGNAS(sizeof(VALUE)) ary[RSTRING_EMBED_LEN_MAX + 1];
+	char RUBY_ALIGNAS(SIZEOF_VALUE) ary[RSTRING_EMBED_LEN_MAX + 1];
     } as;
 };
 #define RSTRING_EMBED_LEN(str) \

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]