Skip to content

Instantly share code, notes, and snippets.

View sketch34's full-sized avatar
👨‍🍼

Jarrod Smith sketch34

👨‍🍼
View GitHub Profile
@engie
engie / shared_ptr_pooling.cpp
Created September 25, 2013 12:17
Notes on pooling shared ptr's
//Storing shared pointers in boost pool allocators
//tl;dr It just works (tm)
//
//* If a lot of smallish objects are being allocated & freed a pool allocator
//can speed things up by specialising in allocating exactly that size of
//object.
//
//* If pointer lifetimes need to be managed with reference counting,
//std::shared_ptr can wrap an object to provide safe reference counting.
//