Boost logo

Boost :

Subject: Re: [boost] [gsoc] Pointer Plus Bits Behavior and Interface
From: Brian Bartman (bbartmanboost_at_[hidden])
Date: 2010-07-15 10:37:17


On Thu, Jul 15, 2010 at 10:27 AM, Joaquin M Lopez Munoz <joaquin_at_[hidden]>wrote:

> Brian Bartman <bbartmanboost <at> gmail.com> writes:
>
> > Hello,
> >
> > Pointer Plus Bits: Is a data structure which points to specifically
> aligned
> > object such that the value of the address is divisible by a power of two
> > (the power of two which it is divisible by is given as a template
> argument).
> > The empty bits of the pointer are then used to store extra boolean values
> > relating to something [...]
>
> FYI, there's some code at
>
>
> http://bannalia.blogspot.com/2008/11/optimizing-red-black-tree-color-bits.html
>
> that you might want to leverage for your work.
>
>
Thank you for the link. I did have that in my original proposal as it was
one of the best examples for just how much space can be saved by using this
technique.

> > 1) Should the pointer_plus_bits have a pre and post increment and
> decrement
> > ( what about supporting other arithmetic operations such as add, minus,
> add
> > assign etc...) ?
>
> I'd say this is gratuituous complication: just design a lean
> interface providing get_pointer, set_pointer, get_bit, set_bit
> (or similar names) so that you don't have to replicate pointer
> semantics.
>
>
So you suggest that I may be going overboard. OK, I'm OK with less work it
just means I have more time to spend on testing. Thanks for the quick reply.

> Joaquín M López Muñoz
> Telefónica, Investigación y Desarrollo
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost

-- 
thanks,
Brian Bartman

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk