logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Re: RFA/types: Clean up use of field bitsize: msg#00742

Subject: Re: RFA/types: Clean up use of field bitsize

> So, since I needed to gain a new field here anyway, and since I have no
> compunctions about shrinking this field a little (packed bitfields of size
> greater than a couple of words are allowed in some languages IIRC (including
> GNU C maybe?  Although they are not allowed in ISO C99), but they're
> definitely dodgy), and since signed bitfields are not portable, I cleaned up
> the construct.  It turned out to be painless except for making sure symbol
> readers initialized it, which was a little tedious.

Well, as it happens, Ada IS able to handle bit fields of arbitrary size.
However, given that you have left 29 bits (unsigned), and that the gain from
decreasing one's memory usage by 0.000006% (31 bits of 2**29) is insignificant
compared to the enormous cost of extracting 2**29-bit, arbitrarily aligned
fields, I'd say that this change is reasonable (:->).

P. Hilfinger
Ada Core Technologies, Inc.




<Prev in Thread] Current Thread [Next in Thread>