mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user