httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@gmail.com>
Subject Re: svn commit: r1026668 - /httpd/httpd/trunk/modules/proxy/mod_proxy.h
Date Sat, 23 Oct 2010 20:24:42 GMT
On Sat, Oct 23, 2010 at 3:58 PM, Graham Leggett <minfrin@sharp.fm> wrote:
> On 23 Oct 2010, at 9:51 PM, William A. Rowe Jr. wrote:
>
>>> @@ -325,7 +325,7 @@ struct proxy_worker {
>>>    apr_port_t      port;
>>>    char            keepalive;
>>>    char            disablereuse;
>>> -    int             is_address_reusable;
>>> +    int             is_address_reusable:1;
>>>    proxy_conn_pool     *cp;        /* Connection pool to use */
>>>    proxy_worker_stat   *s;         /* Shared data */
>>>    void            *opaque;    /* per scheme worker data */
>>
>> No; this is a dis-optimization.  You have added int-bitmath cpu cycles
>> to a simple int test, without gaining any storage.  Huh?
>
> Are you sure?
>
> I would expect a compiler optimiser to do the most appropriate thing, and it
> gets us out of the habit of allocating an int or a char every time we need a
> boolean flag.

It can't reorder fields, and pointers and integers need to be on
"natural" boundaries for performance (or even outright functionality
on some platforms).  So there will be padding after the bit.

Some Intel ABI spec would show alignment requirements for a notable
example platform, absent of any packing pragmas.

Mime
View raw message