From 492d8331e1c652466deadad8639e3f93c5c39a62 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Wed, 10 Apr 2024 13:35:03 +0900 Subject: [PATCH] mruby-io/ext/io.h: reorder struct mrb_io to reduce the size; #6231 The `sizeof(struct mrb_io)` is reduced from 32 bytes to 24 bytes on x86_64-linux. --- mrbgems/mruby-io/include/mruby/ext/io.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mrbgems/mruby-io/include/mruby/ext/io.h b/mrbgems/mruby-io/include/mruby/ext/io.h index ba235cb21..61f7533f5 100644 --- a/mrbgems/mruby-io/include/mruby/ext/io.h +++ b/mrbgems/mruby-io/include/mruby/ext/io.h @@ -33,10 +33,6 @@ struct mrb_io_buf { }; struct mrb_io { - int fd; /* file descriptor, or -1 */ - int fd2; /* file descriptor to write if it's different from fd, or -1 */ - int pid; /* child's pid (for pipes) */ - struct mrb_io_buf *buf; unsigned int readable:1, writable:1, eof:1, @@ -44,6 +40,10 @@ struct mrb_io { is_socket:1, close_fd:1, close_fd2:1; + int fd; /* file descriptor, or -1 */ + int fd2; /* file descriptor to write if it's different from fd, or -1 */ + int pid; /* child's pid (for pipes) */ + struct mrb_io_buf *buf; }; #define MRB_O_RDONLY 0x0000