From 0a2c4b4c2a51044743e26daf1984558d34f9b78a Mon Sep 17 00:00:00 2001 From: normal Date: Sun, 20 Jul 2014 04:51:35 +0000 Subject: [PATCH] rb_econv_t: reduce to 184 bytes from 200 on 64-bit * transcode.c (rb_econv_t): reduce to 184 bytes from 200 on 64-bit This allows rb_econv_t to fit inside of three cache lines on x86-64. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ transcode.c | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index ffedc38209..cb258298e1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sun Jul 20 13:50:34 2014 Eric Wong + + * transcode.c (rb_econv_t): reduce to 184 bytes from 200 on 64-bit + Sun Jul 20 12:44:23 2014 Eric Wong * include/ruby/io.h (rb_io_buffer_t): pack structure diff --git a/transcode.c b/transcode.c index b640008206..5f326fd952 100644 --- a/transcode.c +++ b/transcode.c @@ -110,21 +110,21 @@ typedef struct { struct rb_econv_t { int flags; + int started; /* bool */ + const char *source_encoding_name; const char *destination_encoding_name; - int started; - const unsigned char *replacement_str; size_t replacement_len; const char *replacement_enc; - int replacement_allocated; unsigned char *in_buf_start; unsigned char *in_data_start; unsigned char *in_data_end; unsigned char *in_buf_end; rb_econv_elem_t *elems; + int replacement_allocated; /* bool */ int num_allocated; int num_trans; int num_finished;