summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-22 00:46:25 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-22 00:46:25 +0000
commit4d10c2b91d408ac3a8cc6b1d5da2103a0c527d47 (patch)
treec52e7a6b7287caf8a4972cd92ed4a678cec3db17
parent6a7d389ed0bae2083b6608072fad34e64b3901d7 (diff)
ext/socket/*.c: trivial struct packing for 64-bit
* ext/socket/ancdata.c ({send,recv}msg_args_struct): 24 => 16 bytes * ext/socket/init.c (connect_arg): ditto * ext/socket/raddrinfo.c (getnameinfo_arg): 56 => 48 bytes Other big stack reductions are less trivial. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--ext/socket/ancdata.c4
-rw-r--r--ext/socket/init.c2
-rw-r--r--ext/socket/raddrinfo.c2
4 files changed, 11 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index cf44890..bf48bea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Mon Sep 22 09:28:43 2014 Eric Wong <e@80x24.org>
+
+ * ext/socket/ancdata.c ({send,recv}msg_args_struct): 24 => 16 bytes
+ * ext/socket/init.c (connect_arg): ditto
+ * ext/socket/raddrinfo.c (getnameinfo_arg): 56 => 48 bytes
+ (reductions only for 64-bit systems)
+
Mon Sep 22 02:04:25 2014 Tanaka Akira <akr@fsij.org>
* lib/drb/drb.rb: Support graceful shutdown.
diff --git a/ext/socket/ancdata.c b/ext/socket/ancdata.c
index 218085d..f0dbb2b 100644
--- a/ext/socket/ancdata.c
+++ b/ext/socket/ancdata.c
@@ -1105,8 +1105,8 @@ ancillary_cmsg_is_p(VALUE self, VALUE vlevel, VALUE vtype)
#if defined(HAVE_SENDMSG)
struct sendmsg_args_struct {
int fd;
- const struct msghdr *msg;
int flags;
+ const struct msghdr *msg;
};
static void *
@@ -1358,8 +1358,8 @@ rsock_bsock_sendmsg_nonblock(int argc, VALUE *argv, VALUE sock)
#if defined(HAVE_RECVMSG)
struct recvmsg_args_struct {
int fd;
- struct msghdr *msg;
int flags;
+ struct msghdr *msg;
};
ssize_t
diff --git a/ext/socket/init.c b/ext/socket/init.c
index 670349a..bcc1e52 100644
--- a/ext/socket/init.c
+++ b/ext/socket/init.c
@@ -400,8 +400,8 @@ wait_connectable(int fd)
struct connect_arg {
int fd;
- const struct sockaddr *sockaddr;
socklen_t len;
+ const struct sockaddr *sockaddr;
};
static VALUE
diff --git a/ext/socket/raddrinfo.c b/ext/socket/raddrinfo.c
index ceed9c3..8e64347 100644
--- a/ext/socket/raddrinfo.c
+++ b/ext/socket/raddrinfo.c
@@ -312,11 +312,11 @@ struct getnameinfo_arg
{
const struct sockaddr *sa;
socklen_t salen;
+ int flags;
char *host;
size_t hostlen;
char *serv;
size_t servlen;
- int flags;
};
static void *