inline u8 *_rtw_zvmalloc(u32 sz) { u8 *pbuf; pbuf = _rtw_vmalloc(sz); if (pbuf != NULL) memset(pbuf, 0, sz); return pbuf; }
inline u8* _rtw_zvmalloc(u32 sz) { u8 *pbuf; #ifdef PLATFORM_LINUX pbuf = _rtw_vmalloc(sz); if (pbuf != NULL) memset(pbuf, 0, sz); #endif return pbuf; }
inline u8* dbg_rtw_vmalloc(u32 sz, const char *func, int line) { u8 *p; DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz)); p=_rtw_vmalloc((sz)); rtw_update_mem_stat( p ? MEM_STAT_VIR_ALLOC_SUCCESS : MEM_STAT_VIR_ALLOC_FAIL , sz ); return p; }
inline u8* dbg_rtw_vmalloc(u32 sz, const enum mstat_f flags, const char *func, const int line) { u8 *p; //DBG_871X("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz)); p=_rtw_vmalloc((sz)); rtw_mstat_update( flags , p ? MSTAT_ALLOC_SUCCESS : MSTAT_ALLOC_FAIL , sz ); return p; }
inline u8* _rtw_zvmalloc(u32 sz) { u8 *pbuf; #ifdef PLATFORM_LINUX pbuf = _rtw_vmalloc(sz); if (pbuf != NULL) memset(pbuf, 0, sz); #endif #ifdef PLATFORM_WINDOWS NdisAllocateMemoryWithTag(&pbuf,sz, RT_TAG); if (pbuf != NULL) NdisFillMemory(pbuf, sz, 0); #endif return pbuf; }
inline u8* dbg_rtw_vmalloc(u32 sz, const char *func, int line) { DBG_871X("%s:%d %s(%d)\n", func, line, __FUNCTION__, (sz)); return _rtw_vmalloc((sz)); }