Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Aug 2017 07:30:19 -0700
From:      John Baldwin <jhb@freebsd.org>
To:        Maxim Sobolev <sobomax@freebsd.org>
Cc:        Ryan Libby <rlibby@freebsd.org>, svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers <src-committers@freebsd.org>
Subject:   Re: svn commit: r322969 - in head: sbin/mdconfig sys/dev/md sys/sys
Message-ID:  <6350259.n2rmZ9RnEY@ralph.baldwin.cx>
In-Reply-To: <CAH7qZftFAzfsgfgHV2=59Ah2LPfMC_CFYUEfiFZSWbf7jMZUTg@mail.gmail.com>
References:  <201708281554.v7SFs8fr014268@repo.freebsd.org> <2937323.CvTEtZnL2T@ralph.baldwin.cx> <CAH7qZftFAzfsgfgHV2=59Ah2LPfMC_CFYUEfiFZSWbf7jMZUTg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday, August 28, 2017 04:40:49 PM Maxim Sobolev wrote:
> John, well, this depends on how you look at it. The padding element size is
> "int", which when you account for the alignment has the nice property on
> both 32 and 64-bit arches that no matter what kind of element you add
> (char, short, int or void *), you only need to bring down MDNPAD by 1 to
> keep the structure size the same.

That's only true once.  Add a second pointer and this trick won't work again
on 64-bit platforms.  It only worked this time by accident because there was
unaccounted-for padding at the end of the structure, not on purpose.  In
other places in the tree where ABI is more carefully maintained we use
explicit spare pointers or spare longs instead (e.g. padding in kinfo_proc).

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6350259.n2rmZ9RnEY>