Boost logo

Boost :

Subject: Re: [boost] Interest request for pointer+bit compression optimization
From: Neil Groves (neil_at_[hidden])
Date: 2009-09-07 13:42:57

On Mon, Sep 7, 2009 at 6:33 PM, Edouard A. <edouard_at_[hidden]> wrote:

> >I was wondering if it would be interesting to provide some generic
> template
> classes making >easier this kind of optimization.
> Yes, at least for me.
> You actually have more than one bit available as the OS generally reserves
> a
> huge area of virtual memory for the kernel. Typical example, Windows 32,
> maximum user pointer value is 0x80000000. Don't remember the values by
> heart
> for the other oses.
This is incorrect. The pointer limit is only limited to under 0x80000000 if
you are linking without the /LARGEADDRESSAWARE flag. It is quite common to
use this flag to enable the best performance of a 32-bit application on a
64-bit version of Windows. It can also have some benefit when using the
boot.ini /3GB tuning.

> On 64-bit OSes you really can use the large pointers to store data and
> therefore have very compact structures in memory. Correct me if I'm wrong
> but currently most OSes only allow several gigabytes of virtual memory for
> any given user process (something like 100-200 GB), that means there's room
> for expression! :D
The limit is as high as 8TB on some Windows 64-bit Operating Systems.

> In addition, embedding a tag within a pointer is a technique to reduce the
> ABA problem occurrence on lockfree containers.
> It would be a nice to have IMHO, but there is a huge work of testing to
> make
> it safe and reliable.

> --
> EA

Neil Groves

Boost list run by bdawes at, gregod at, cpdaniel at, john at