Skip to content

Commit

Permalink
Add common/singleton_object_pool.h
Browse files Browse the repository at this point in the history
  • Loading branch information
hainest committed Apr 3, 2024
1 parent 571c742 commit a5450e4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
1 change: 0 additions & 1 deletion common/src/singleton_object_pool.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include "dthread.h"
#include "compiler_annotations.h"

// This is only safe for objects with nothrow constructors...
template <typename T, typename Alloc = std::allocator<T> >
class singleton_object_pool : public Alloc
{
Expand Down
16 changes: 15 additions & 1 deletion docs/common/developer/singleton_object_pool.h.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,19 @@
singleton_object_pool.h
#######################

.. cpp:namespace:: Dyninst
.. warning:: This is only safe for objects with nothrow constructors.

.. cpp:class:: template <typename T, typename Alloc = std::allocator<T>> singleton_object_pool : public Alloc

.. cpp:function:: static pointer allocate( size_type n )
.. cpp:function:: static void deallocate( pointer p )
.. cpp:function:: template<typename... Args> static T* construct(Args&&... args)
.. cpp:function:: static void destroy(pointer p)

.. cpp:function:: template <typename T, typename Alloc> typename singleton_object_pool<T, Alloc>::pointer singleton_object_pool<T, Alloc>::allocate( size_type n )

.. cpp:struct template <typename T> PoolDestructor
.. cpp:function:: void operator()(T* e)
.. cpp:function:: template <typename T> boost::shared_ptr<T> make_shared(T* t)

0 comments on commit a5450e4

Please sign in to comment.