|
ngl_server 1.0
基于 Actor 模型的 C++ 服务器框架
|
pack_head对象的内存池。 More...
#include <pack_head.h>
Static Public Member Functions | |
| static char * | malloc () |
| 从内存池分配一个pack_head对象。 | |
| static void | free (char *p) |
| 将pack_head对象释放回内存池。 | |
| Static Public Member Functions inherited from ngl::buff_pool< enum_pack_head_pool_bytes, 1 > | |
| static void | track_alloc (holder &aholder, int16_t aindex) |
| static void | maybe_flush (holder &aholder) |
| static bucket_stats | aggregate_global_stats () |
| static bucket_stats | aggregate_bucket_stats (int abucket_idx) |
| static std::vector< uint64_t > | get_bucket_peak_per_thread (int abucket_idx) |
| static constexpr std::array< int32_t, TCOUNT > | get_bytes () |
Additional Inherited Members | |
| Public Member Functions inherited from ngl::buff_pool< enum_pack_head_pool_bytes, 1 > | |
| buff_pool (const std::array< int32_t, TCOUNT > &acounts) | |
| char * | malloc_private (int32_t abytes) |
| void | free_private (char *abuff) |
| const std::array< int32_t, TCOUNT > & | get_counts () const |
| void | print_stats () const |
pack_head对象的内存池。
继承自buff_pool,用于分配和释放pack_head对象,减少内存碎片。 使用单例模式,确保全局只有一个内存池实例。
|
inlinestatic |
将pack_head对象释放回内存池。
| p | 要释放的内存指针。 |
|
inlinestatic |
从内存池分配一个pack_head对象。