On Wed, Jun 01, 2011 at 01:48:03PM +0200, Steffen Daode Nurpmeso wrote:
> @ Corey <[email protected]> wrote (2011-06-01 04:39+0200):
> > I mean, come on -- storing data in "unused" bits in a pointer? Even
> > I know that's a bad idea.
>
> But really, there are user-space memory pools which align on 8 or
> 16 byte boundaries, so here you have at least three perfectly fine
> bits. That's at least sometimes much much better than growing
> a structure by that very size for one bit or two.
> Super object. Washing machine.
> (Ooh - upper bounds are beyond my scope.)
Storing tag bits in the lower bits of a pointer can be ok indeed if
you know things about alignment restrictions.
Using higher bits because they *seem* unused will bite you sooner or
later.
-Otto