void *my_malloc(unsigned int uSize, const char *pszFunc, unsigned int uLine)
{
void *pPtr = malloc(uSize);
printf("[MALLOC][func:%s][line:%d][add:%p][size:%d]\n", pszFunc, uLine,pPtr,uSize);
return pPtr;
}
void my_free(void *pPtr, const char *pszFunc, unsigned int uLine)
{
printf("[ FREE ][func:%s][line:%d][add:%p]\n", pszFunc, uLine,pPtr);
return free(pPtr);
}
#define malloc(size) my_malloc(size, __FUNCTION__, __LINE__)
#define free(ptr) my_free(ptr, __FUNCTION__, __LINE__);
malloc和free重写
最新推荐文章于 2022-12-23 15:37:05 发布