X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2F5gnrmac%2Fmac_utils.h;h=99b07e442461946673d4d57d003556bf178a14bc;hb=fc7d3ce9647a7da04f5a67fa34419076069defc1;hp=fea6322f55f3333eca7400dc77f2de065b1812cd;hpb=6418f704150760e4d8a885cda583e4010a406152;p=o-du%2Fl2.git diff --git a/src/5gnrmac/mac_utils.h b/src/5gnrmac/mac_utils.h index fea6322f5..99b07e442 100644 --- a/src/5gnrmac/mac_utils.h +++ b/src/5gnrmac/mac_utils.h @@ -23,6 +23,17 @@ #define MAC_MEM_REGION 4 #define MAC_POOL 1 +/* allocate and zero out a static buffer */ + +#ifdef MEM_SIZE_CHECK +#define MAC_MEMORY_ALLOC_SIZE_LOG(_line, _func, _size) \ +{\ + DU_LOG("\n MAC line = %d, func = %s, _size= %d ", _line, _func, _size); \ +} +#else +#define MAC_MEMORY_ALLOC_SIZE_LOG(_line, _func, _size) {} +#endif + #ifdef ODU_MEMORY_DEBUG_LOG #define MAC_MEM_LOG(_macro, _file, _line, _func, _size, _datPtr)\ {\ @@ -36,6 +47,7 @@ /* allocate and zero out a MAC static buffer */ #define MAC_ALLOC(_datPtr, _size) \ { \ + MAC_MEMORY_ALLOC_SIZE_LOG(__LINE__, __FUNCTION__, _size); \ uint8_t _ret; \ _ret = SGetSBuf(MAC_MEM_REGION, MAC_POOL, \ (Data **)&_datPtr, _size); \ @@ -66,6 +78,7 @@ * during inter-layer communication */ #define MAC_ALLOC_SHRABL_BUF(_buf, _size) \ { \ + MAC_MEMORY_ALLOC_SIZE_LOG(__LINE__, __FUNCTION__, _size); \ if(SGetStaticBuffer(MAC_MEM_REGION, MAC_POOL, \ (Data **)&_buf, (Size) _size, 0) == ROK) \ { \