diff --git a/include/osdep_service.h b/include/osdep_service.h index 54139a3..0fedf0d 100644 --- a/include/osdep_service.h +++ b/include/osdep_service.h @@ -212,7 +212,6 @@ void dbg_rtw_usb_buffer_free(struct usb_device *dev, size_t size, void *addr, dm #define rtw_mstat_update(flag, status, sz) do {} while (0) #define rtw_mstat_dump(sel) do {} while (0) #define match_mstat_sniff_rules(flags, size) _FALSE -void *_rtw_vmalloc(u32 sz); void *_rtw_zvmalloc(u32 sz); void *_rtw_zmalloc(u32 sz); void *_rtw_malloc(u32 sz); @@ -238,7 +237,7 @@ void _rtw_usb_buffer_free(struct usb_device *dev, size_t size, void *addr, dma_a #ifdef CONFIG_USE_VMALLOC #define rtw_zvmalloc(sz) _rtw_zvmalloc((sz)) -#define rtw_vmalloc_f(sz, mstat_f) _rtw_vmalloc((sz)) +#define rtw_vmalloc_f(sz, mstat_f) vmalloc((sz)) #define rtw_zvmalloc_f(sz, mstat_f) _rtw_zvmalloc((sz)) #define rtw_vmfree_f(pbuf, sz, mstat_f) _rtw_vmfree((pbuf), (sz)) #else /* CONFIG_USE_VMALLOC */ diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c index 3621b6e..1e23cc0 100644 --- a/os_dep/osdep_service.c +++ b/os_dep/osdep_service.c @@ -65,37 +65,11 @@ u32 rtw_atoi(u8 *s) } -inline void *_rtw_vmalloc(u32 sz) -{ - void *pbuf; -#ifdef PLATFORM_LINUX - pbuf = vmalloc(sz); -#endif -#ifdef PLATFORM_FREEBSD - pbuf = malloc(sz, M_DEVBUF, M_NOWAIT); -#endif - -#ifdef PLATFORM_WINDOWS - NdisAllocateMemoryWithTag(&pbuf, sz, RT_TAG); -#endif - -#ifdef DBG_MEMORY_LEAK -#ifdef PLATFORM_LINUX - if (pbuf != NULL) { - atomic_inc(&_malloc_cnt); - atomic_add(sz, &_malloc_size); - } -#endif -#endif /* DBG_MEMORY_LEAK */ - - return pbuf; -} - inline void *_rtw_zvmalloc(u32 sz) { void *pbuf; #ifdef PLATFORM_LINUX - pbuf = _rtw_vmalloc(sz); + pbuf = vmalloc(sz); if (pbuf != NULL) memset(pbuf, 0, sz); #endif @@ -547,7 +521,7 @@ inline void *dbg_rtw_vmalloc(u32 sz, const enum mstat_f flags, const char *func, if (match_mstat_sniff_rules(flags, sz)) RTW_INFO("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz)); - p = _rtw_vmalloc((sz)); + p = vmalloc(sz); rtw_mstat_update( flags