summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-20 04:19:06 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-07-20 04:19:06 +0000
commiteeb05e8c119f8cab6434d90f21551b6bb2954778 (patch)
tree7dc64b7eaf3b82e56331c7215ea976596f9dbefd /include
parent910d081d02ec6fd1fbfe028755a94065bf4c2661 (diff)
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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include')
-rw-r--r--include/ruby/io.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/ruby/io.h b/include/ruby/io.h
index bdde984..8f03677 100644
--- a/include/ruby/io.h
+++ b/include/ruby/io.h
@@ -51,12 +51,12 @@ extern "C" {
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 */