Common System 0.2.0
Common interfaces and patterns for system integration
Loading...
Searching...
No Matches
object_pool.h File Reference

Thread-safe object pool reusing raw storage for expensive objects. More...

#include <cstddef>
#include <memory>
#include <mutex>
#include <stack>
#include <utility>
#include <new>
#include <vector>
Include dependency graph for object_pool.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  kcenon::common::utils::detail::RawDelete< T >
 
struct  kcenon::common::utils::PoolDeleter< T >
 Zero-overhead deleter for ObjectPool-managed objects. More...
 
class  kcenon::common::utils::ObjectPool< T >
 Thread-safe object pool that reuses raw storage for expensive objects. More...
 

Namespaces

namespace  kcenon
 
namespace  kcenon::common
 Core interfaces.
 
namespace  kcenon::common::utils
 
namespace  kcenon::common::utils::detail
 

Detailed Description

Thread-safe object pool reusing raw storage for expensive objects.

Allocates raw memory once, performs placement-new on acquisition, and destructs (but does not deallocate) on release. Reduces allocation overhead for frequently created/destroyed objects.

Definition in file object_pool.h.