diff options
| -rw-r--r-- | src/zenutil/include/zenutil/mimalloc_hooks.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/zenutil/include/zenutil/mimalloc_hooks.h b/src/zenutil/include/zenutil/mimalloc_hooks.h new file mode 100644 index 000000000..e7f354e2d --- /dev/null +++ b/src/zenutil/include/zenutil/mimalloc_hooks.h @@ -0,0 +1,32 @@ + +// Copyright Epic Games, Inc. All Rights Reserved. + +#if ZEN_USE_MIMALLOC +ZEN_THIRD_PARTY_INCLUDES_START +# include <mimalloc.h> +ZEN_THIRD_PARTY_INCLUDES_END + +# define ZEN_MIMALLOC_FUNCTIONS \ + ZEN_MI_FUNCTION(mi_malloc) \ + ZEN_MI_FUNCTION(mi_calloc) \ + ZEN_MI_FUNCTION(mi_realloc) \ + ZEN_MI_FUNCTION(mi_expand) \ + ZEN_MI_FUNCTION(mi_free) \ + ZEN_MI_FUNCTION(mi_expand) \ + ZEN_MI_FUNCTION(mi_strdup) \ + ZEN_MI_FUNCTION(mi_strndup) \ + ZEN_MI_FUNCTION(mi_realpath) \ + ZEN_MI_FUNCTION(mi_expand) \ + ZEN_MI_FUNCTION(mi_malloc_aligned) \ + ZEN_MI_FUNCTION(mi_realloc_aligned) + +struct MimallocHooks +{ +# define ZEN_MI_FUNCTION(func) \ + using Decl_##func = decltype(func); \ + Decl_##func* Pfn##func; + ZEN_MIMALLOC_FUNCTIONS +# undef ZEN_MI_FUNCTION +}; + +#endif |