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

ruby-changes:34801

From: normal <ko1@a...>
Date: Sun, 20 Jul 2014 13:19:19 +0900 (JST)
Subject: [ruby-changes:34801] normal:r46884 (trunk): rb_io_buffer_t: pack structure

normal	2014-07-20 13:19:06 +0900 (Sun, 20 Jul 2014)

  New Revision: 46884

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

  Log:
    rb_io_buffer_t: pack structure
    
    * include/ruby/io.h (rb_io_buffer_t): pack structure
      Reduces rb_io_t from 200 to 192 bytes, allowing rb_io_t to
      occupy one less cache line.
      [Feature #10050]
    
    n.b. this leaves a 4-byte hole after the `cbuf' field which may
    be used for future expansion.

  Modified files:
    trunk/ChangeLog
    trunk/include/ruby/io.h
Index: include/ruby/io.h
===================================================================
--- include/ruby/io.h	(revision 46883)
+++ include/ruby/io.h	(revision 46884)
@@ -51,12 +51,12 @@ extern "C" { https://github.com/ruby/ruby/blob/trunk/include/ruby/io.h#L51
 
 RUBY_SYMBOL_EXPORT_BEGIN
 
-typedef struct {
+typedef PACKED_STRUCT(struct {
     char *ptr;                  /* off + len <= capa */
     int off;
     int len;
     int capa;
-} rb_io_buffer_t;
+}) rb_io_buffer_t;
 
 typedef struct rb_io_t {
     FILE *stdio_file;		/* stdio ptr for read/write if available */
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 46883)
+++ ChangeLog	(revision 46884)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sun Jul 20 12:44:23 2014  Eric Wong  <e@8...>
+
+	* include/ruby/io.h (rb_io_buffer_t): pack structure
+	  Reduces rb_io_t from 200 to 192 bytes, allowing rb_io_t to
+	  occupy one less cache line.
+	  [Feature #10050]
+
 Sun Jul 20 12:41:53 2014  Eric Wong  <e@8...>
 
 	* include/ruby/io.h (rb_io_t): shrink to 200 bytes from 216 on 64-bit

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

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