diff --git a/lib/include/srslte/adt/mem_pool.h b/lib/include/srslte/adt/mem_pool.h index 1277e3d8d..935e6a733 100644 --- a/lib/include/srslte/adt/mem_pool.h +++ b/lib/include/srslte/adt/mem_pool.h @@ -254,6 +254,7 @@ public: void deallocate_node(void* p) { std::lock_guard lock(mutex); + assert(p != nullptr); if (p != nullptr) { obj_cache.push(static_cast(p)); } diff --git a/srsenb/hdr/stack/rrc/rrc.h b/srsenb/hdr/stack/rrc/rrc.h index a8685eb8f..713f8f41a 100644 --- a/srsenb/hdr/stack/rrc/rrc.h +++ b/srsenb/hdr/stack/rrc/rrc.h @@ -18,7 +18,6 @@ #include "rrc_metrics.h" #include "srsenb/hdr/stack/upper/common_enb.h" #include "srslte/adt/circular_buffer.h" -#include "srslte/adt/mem_pool.h" #include "srslte/common/buffer_pool.h" #include "srslte/common/common.h" #include "srslte/common/stack_procedure.h" diff --git a/srsenb/hdr/stack/rrc/rrc_ue.h b/srsenb/hdr/stack/rrc/rrc_ue.h index 9505fcd06..fab63a10f 100644 --- a/srsenb/hdr/stack/rrc/rrc_ue.h +++ b/srsenb/hdr/stack/rrc/rrc_ue.h @@ -15,6 +15,7 @@ #include "mac_controller.h" #include "rrc.h" +#include "srslte/adt/mem_pool.h" #include "srslte/interfaces/enb_phy_interfaces.h" #include "srslte/interfaces/pdcp_interface_types.h" @@ -119,7 +120,8 @@ public: void operator delete(void* ptr)noexcept; void operator delete[](void* ptr) = delete; - static srslte::background_allocator_obj_pool* get_ue_pool(); + using ue_pool_t = srslte::background_allocator_obj_pool; + static ue_pool_t* get_ue_pool(); private: // args diff --git a/srsenb/src/stack/rrc/rrc_ue.cc b/srsenb/src/stack/rrc/rrc_ue.cc index da1eaacb9..134f75738 100644 --- a/srsenb/src/stack/rrc/rrc_ue.cc +++ b/srsenb/src/stack/rrc/rrc_ue.cc @@ -67,7 +67,7 @@ srslte::background_allocator_obj_pool* rrc::ue::get_ue_pool() { // Note: batch allocation is going to be explicitly called in enb class construction. The pool object, therefore, // will only be initialized if we instantiate an eNB - static srslte::background_allocator_obj_pool ue_pool(true); + static rrc::ue::ue_pool_t ue_pool(true); return &ue_pool; }