On Sun, Jul 07, 2002 at 01:14:21PM -0700, Juli Mallett wrote:
> * De: Mike Silbersack <[EMAIL PROTECTED]> [ 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?

Because that is even more oogly than a union.

-- 
Jonathan Mini <[EMAIL PROTECTED]>
http://www.freebsd.org/

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-net" in the body of the message

Reply via email to