Alignment of ws allocations
Poul-Henning Kamp
phk at phk.freebsd.dk
Mon Apr 19 08:43:19 CEST 2010
In message <4BCB27F7.9040304 at schokola.de>, Nils Goroll writes:
>Hi Poul-Henning,
>
>could you provide a brief explanation on your decision to make all WS
>allocations (void *) aligned? http://varnish-cache.org/ticket/665#comment:2
>
>I had considered this solution, but I had thought aligning char * would just be
>a waste of ws space. Or is there anything I don't know?
There are two reasons:
1. It's easier to not have a split-policy
2. Most memcpy() implementations works best with aligned start addresses.
--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
More information about the varnish-dev
mailing list