
----- Original Message ----- From: "Chad Nelson" <chad.thecomfychair@gmail.com> To: <boost@lists.boost.org> Sent: Monday, May 03, 2010 1:00 AM Subject: Re: [boost] [xint] Third release is ready, requesting preliminary review
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 05/02/2010 05:21 PM, vicente.botet wrote:
Could you confirm that this are the only data stored on xint::integer?
flag_t flags; data_t *data;
Yes, that's it, at the moment.
What is the meaning of flags static const flag_t flag_negative = 0x01; static const flag_t flag_readonly = 0x02; static const flag_t flag_fixedlength = 0x04;
The first is used (in the 'flags' bitfield) to denote a negative number. The second identifies data_t items that are meant to never be modified (the zero items assigned when new integers are created without specifying a value, for instance). The third is used on fixed_integer types, to tell the base_integer allocation code to use some special handling for them.
Is the flags field needed when COW is not used?
Yes. I don't think any of those three flags are specific to copy-on-write, except maybe flag_readonly (which prevents the code from writing to a shared zero, for example).
I don't understand why any of these informations is not stored on data_t. In addition no information must be stored on base integer that concerns fixed_integer. This is a bad design option, IMHO. Best, Vicente