Boost logo

Boost :

Subject: [boost] [Block Pointer] Up to 600% faster than Shared Pointer
From: Phil Bouchard (philippeb8_at_[hidden])
Date: 2016-03-11 21:38:46

- I made the proxy explicit. Now it can be used 3 different ways:

1) Clothesline style:

block_proxy x;
block_ptr<int> v = block_ptr<int>(x, new block<int>(11));
block_ptr<int> w = block_ptr<int>(x, new block<int>(12));

2) Root style:

proxy_ptr<char[9]> u = proxy_ptr<char[9]>(new block<char[9]>());

3) Container style (very easy to write containers now):

struct list : block_proxy {
     list() : root(*this) {}
     block_ptr<node> root;

- I removed the capacity to unify sets. Why? Because it's faster &
cleaner without it.

- If we use fastblock<>() then the speedup can go up to 600% compared to

auto_ptr: 23174753 ns
shared_ptr: 49726615 ns
block_ptr: 7812659 ns

- Once again all the examples can be found here:

- And the pointer itself here:


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