From owner-freebsd-net Sun Jul 7 13:14:23 2002 Delivered-To: freebsd-net@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 931) id C0D9937B400; Sun, 7 Jul 2002 13:14:21 -0700 (PDT) Date: Sun, 7 Jul 2002 13:14:21 -0700 From: Juli Mallett To: Mike Silbersack Cc: Alfred Perlstein , net@freebsd.org Subject: Re: the incredible shrinking socket Message-ID: <20020707131421.A50599@FreeBSD.ORG> References: <20020707083710.GM97638@elvis.mu.org> <20020707143846.A13771-100000@patrocles.silby.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <20020707143846.A13771-100000@patrocles.silby.com>; from silby@silby.com on Sun, Jul 07, 2002 at 02:39:53PM -0500 Organisation: The FreeBSD Project X-Alternate-Addresses: , , , X-Affiliated-Projects: FreeBSD, xMach, ircd-hybrid-7 X-Towel: Yes X-LiveJournal: flata X-Negacore: Yes X-Warning: If you make me read stupid email, don't be surprised if I respond. If you don't want me to reply to something, don't send it to me. Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org * De: Mike Silbersack [ Data: 2002-07-07 ] [ Subjecte: Re: the incredible shrinking socket ] > > On Sun, 7 Jul 2002, Alfred Perlstein wrote: > > > Some time ago I noticed that there appeared to be several members > > of struct socket that were either only used by listen sockets or > > only used by data sockets. > > > > I've taken a stab at unionizing the members and we wind up saving > > 28 bytes per socket on i386, and probably nearly double that on > > any 64 bit platform. That's ~15%, which isn't too shabby. > > Unions are ooogly. Would it be possible to seperate listen-only > structures out into a seperate struct instead with a pointer to it? If you're going to do that why not just end the struct with char foo[1]; And overlay the unique bits at the end? Or do we already use storage there? -- Juli Mallett | FreeBSD: The Power To Serve Will break world for fulltime employment. | finger jmallett@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message