acl  3.5.3.0
acl_mem_hook.h 文件参考
#include "acl_define.h"
+ acl_mem_hook.h 的引用(Include)关系图:
+ 此图展示该文件直接或间接的被哪些文件引用了:

浏览源代码.

函数

ACL_API void acl_mem_hook (void *(*malloc_hook)(const char *, int, size_t), void *(*calloc_hook)(const char *, int, size_t, size_t), void *(*realloc_hook)(const char *, int, void *, size_t), char *(*strdup_hook)(const char *, int, const char *), char *(*strndup_hook)(const char *, int, const char *, size_t), void *(*memdup_hook)(const char *, int, const void *, size_t), void(*free_hook)(const char *, int, void *))
 
ACL_API void acl_mem_unhook (void)
 

函数说明

◆ acl_mem_hook()

ACL_API void acl_mem_hook ( void *(*)(const char *, int, size_t)  malloc_hook,
void *(*)(const char *, int, size_t, size_t)  calloc_hook,
void *(*)(const char *, int, void *, size_t)  realloc_hook,
char *(*)(const char *, int, const char *)  strdup_hook,
char *(*)(const char *, int, const char *, size_t)  strndup_hook,
void *(*)(const char *, int, const void *, size_t)  memdup_hook,
void(*)(const char *, int, void *)  free_hook 
)

设置内存分配、释放的注册函数,当ACL内部分配释放内存时便调用这些注册的函数 在调用此函数进行注册时必须保证这几个函数指针参数均非空

参数
malloc_hook{void *(*)(const char* fname, int lineno, size_t)}
calloc_hook{void *(*)(const char* fname, int lineno, size_t, size_t)}
realloc_hook{void *(*)(const char* fname, int lineno, void *, size_t)}
strdup_hook{void *(*)(const char* fname, int lineno, const char*)}
strndup_hook{void *(*)(const char* fname, int lineno, const char*, size_t)}
memdup_hook{void *(*)(const char* fname, int lineno, const void *, size_t)}
free_hook{void (*)(const char* fname, int lineno, void*)}

◆ acl_mem_unhook()

ACL_API void acl_mem_unhook ( void  )

取消之前设置的内存勾子函数,恢复为缺省状态