X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrrlc%2Frlc_utils.h;h=dfdc3127769c99e16201c9173be99975be8a0554;hb=fc7d3ce9647a7da04f5a67fa34419076069defc1;hp=5ec43d46ad6581fb89791dcba5f631bec17f12ec;hpb=6418f704150760e4d8a885cda583e4010a406152;p=o-du%2Fl2.git diff --git a/src/5gnrrlc/rlc_utils.h b/src/5gnrrlc/rlc_utils.h index 5ec43d46a..dfdc31277 100755 --- a/src/5gnrrlc/rlc_utils.h +++ b/src/5gnrrlc/rlc_utils.h @@ -104,6 +104,15 @@ extern "C" { * Memory related Defines ******************************************************************************/ /* Allocate function */ +#ifdef MEM_SIZE_CHECK +#define RLC_MEMORY_ALLOC_SIZE_LOG(_line, _func, _size) \ +{\ + DU_LOG("\nRLC line = %d, func = %s, _size= %d ", _line, _func, _size); \ +} +#else +#define RLC_MEMORY_ALLOC_SIZE_LOG(_line, _func, _size) {} +#endif + #ifdef ODU_MEMORY_DEBUG_LOG #define RLC_MEM_LOG(_macro, _file, _line, _func, _size, _datPtr)\ {\ @@ -116,6 +125,7 @@ extern "C" { #define RLC_ALLOC(_cb,_buf, _size) \ { \ + RLC_MEMORY_ALLOC_SIZE_LOG(__LINE__, __FUNCTION__, _size); \ if (SGetSBuf(_cb->init.region, _cb->init.pool, (Data **)&_buf, \ (Size) _size) == ROK) \ { \ @@ -162,6 +172,7 @@ extern "C" { #define RLC_ALLOC_SHRABL_BUF_WC(_region, _pool,_buf, _size) \ { \ + RLC_MEMORY_ALLOC_SIZE_LOG(__LINE__, __FUNCTION__, _size); \ if(SGetStaticBuffer(_region, _pool, (Data **)&_buf, \ (Size) _size, 0)==ROK) \ {\ @@ -175,6 +186,7 @@ extern "C" { #define RLC_ALLOC_SHRABL_BUF(_region, _pool,_buf, _size) \ { \ + RLC_MEMORY_ALLOC_SIZE_LOG(__LINE__, __FUNCTION__, _size); \ if (SGetStaticBuffer(_region, _pool, (Data **)&_buf, \ (Size) _size, 0) == ROK) \ { \ @@ -189,6 +201,7 @@ extern "C" { #define RLC_ALLOC_WC(_cb,_buf, _size) \ {\ + RLC_MEMORY_ALLOC_SIZE_LOG(__LINE__, __FUNCTION__, _size); \ if(SGetSBuf(_cb->init.region, _cb->init.pool, (Data **)&_buf, (Size) _size) == ROK)\ {\ RLC_MEM_LOG("RLC,ALLOC_WC", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\ @@ -270,6 +283,7 @@ extern "C" { #define RLC_SHRABL_STATIC_BUF_ALLOC(_region, _pool, _buf, _size) \ { \ + RLC_MEMORY_ALLOC_SIZE_LOG(__LINE__, __FUNCTION__, _size); \ SGetStaticBuffer(_region, _pool, (Data **)&_buf, \ (Size) _size, 0); \ RLC_MEM_LOG("RLC,SHRABL_STATIC_BUF_ALLOC", __FILE__, __LINE__, __FUNCTION__, _size, _buf);\