зеркало из https://github.com/github/ruby.git
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
This commit is contained in:
Родитель
910d081d02
Коммит
eeb05e8c11
|
@ -1,3 +1,10 @@
|
||||||
|
Sun Jul 20 12:44:23 2014 Eric Wong <e@80x24.org>
|
||||||
|
|
||||||
|
* 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@80x24.org>
|
Sun Jul 20 12:41:53 2014 Eric Wong <e@80x24.org>
|
||||||
|
|
||||||
* include/ruby/io.h (rb_io_t): shrink to 200 bytes from 216 on 64-bit
|
* include/ruby/io.h (rb_io_t): shrink to 200 bytes from 216 on 64-bit
|
||||||
|
|
|
@ -51,12 +51,12 @@ extern "C" {
|
||||||
|
|
||||||
RUBY_SYMBOL_EXPORT_BEGIN
|
RUBY_SYMBOL_EXPORT_BEGIN
|
||||||
|
|
||||||
typedef struct {
|
typedef PACKED_STRUCT(struct {
|
||||||
char *ptr; /* off + len <= capa */
|
char *ptr; /* off + len <= capa */
|
||||||
int off;
|
int off;
|
||||||
int len;
|
int len;
|
||||||
int capa;
|
int capa;
|
||||||
} rb_io_buffer_t;
|
}) rb_io_buffer_t;
|
||||||
|
|
||||||
typedef struct rb_io_t {
|
typedef struct rb_io_t {
|
||||||
FILE *stdio_file; /* stdio ptr for read/write if available */
|
FILE *stdio_file; /* stdio ptr for read/write if available */
|
||||||
|
|
Загрузка…
Ссылка в новой задаче