HawkTracer  0.10.0
alloc_hooks.h
Go to the documentation of this file.
1 #ifndef HAWKTRACER_ALLOC_HOOKS_H
2 #define HAWKTRACER_ALLOC_HOOKS_H
3 
5 #include <hawktracer/ht_config.h>
6 
7 #ifdef HT_PLATFORM_FEATURE_ALLOC_HOOKS_ENABLED
8 
20 typedef void(*HT_AllocHookMalloc)(void* ret_ptr, size_t size, void* user_data);
21 
30 typedef void(*HT_AllocHookCalloc)(void* ret_ptr, size_t num, size_t size, void* user_data);
31 
40 typedef void(*HT_AllocHookRealloc)(void* ret_ptr, void* ptr, size_t size, void* user_data);
41 
48 typedef void(*HT_AllocHookFree)(void* ptr, void* user_data);
49 
63 HT_API void ht_alloc_hooks_register_hooks(HT_AllocHookMalloc pre_malloc_hook,
64  HT_AllocHookMalloc post_malloc_hook,
65  HT_AllocHookCalloc pre_calloc_hook,
66  HT_AllocHookCalloc post_calloc_hook,
67  HT_AllocHookRealloc pre_realloc_hook,
68  HT_AllocHookRealloc post_realloc_hook,
69  HT_AllocHookFree pre_free_hook,
70  HT_AllocHookFree post_free_hook,
71  void* user_data);
72 
80 HT_API void *ht_alloc_hooks_malloc_skip_hook(size_t size);
81 
90 HT_API void *ht_alloc_hooks_calloc_skip_hook(size_t num, size_t size);
91 
100 HT_API void *ht_alloc_hooks_realloc_skip_hook(void* ptr, size_t size);
101 
106 HT_API void ht_alloc_hooks_free_skip_hook(void* ptr);
107 
109 
110 #endif /* HT_PLATFORM_FEATURE_ALLOC_HOOKS_ENABLED */
111 
112 #endif /* HAWKTRACER_ALLOC_HOOKS_H */
#define HT_API
Defines a directive for exporting/importing symbols from DLL.
Definition: macros.h:76
#define HT_DECLS_END
Defines an end of C linkage block.
Definition: macros.h:17
#define HT_DECLS_BEGIN
Defines a beginning of C linkage block.
Definition: macros.h:16