mirror of
https://github.com/open5gs/open5gs.git
synced 2025-10-23 07:41:57 +00:00
Pool library has the following issues with XXX_cycle, including mme_enb_cycle()/amf_ue_cycle() ``` INIT POOL(SIZE:5) Alloc Node1 Alloc Node2 Alloc Node3 Alloc Node4 Alloc Node5 Free Node4 Free Node3 PoolCycle(Node4) is NULL (Freed...OK!) PoolCycle(Node3) is NULL (Freed...OK!) Alloc Node6 Alloc Node7 PoolCycle(Node4) is Not NULL (Freed...but NOK!) PoolCycle(Node3) is Not NULL (Freed...but NOK!) PoolCycle(Node6) is Not NULL (Allocated...OK!) PoolCycle(Node7) is Not NULL (Allocated...OK!) ``` If we use ogs_poll_alloc() to create and allocate a node, the correct behavior of calling ogs_pool_free() on this node and then later calling ogs_pool_cycle() on this node must always return NULL. However, the behavior of calling ogs_pool_cycle() on this node in the future may return a “valid” pointer. To solve the problem, we added hash id to the pool memory and ogs_pool_find_by_id() function is added.