add_mimalloc.patch 1.1 KB

123456789101112131415161718192021222324252627282930
  1. diff --git a/lzhamdecomp/lzham_core.h b/lzhamdecomp/lzham_core.h
  2. index 2e55362..abb8f71 100644
  3. --- a/lzhamdecomp/lzham_core.h
  4. +++ b/lzhamdecomp/lzham_core.h
  5. @@ -241,7 +241,9 @@ const bool c_lzham_big_endian_platform = !c_lzham_little_endian_platform;
  6. #include <stdlib.h>
  7. #include <stdio.h>
  8. #include <math.h>
  9. -#if !defined(__APPLE__) && !defined(__FreeBSD__)
  10. +#ifdef ASSERT_USE_MIMALLOC
  11. + #include "mimalloc-override.h"
  12. +#elif !defined(__APPLE__) && !defined(__FreeBSD__)
  13. #include <malloc.h>
  14. #endif
  15. #include <stdarg.h>
  16. diff --git a/lzhamdecomp/lzham_mem.cpp b/lzhamdecomp/lzham_mem.cpp
  17. index e8163fa..e82a5d2 100644
  18. --- a/lzhamdecomp/lzham_mem.cpp
  19. +++ b/lzhamdecomp/lzham_mem.cpp
  20. @@ -2,7 +2,9 @@
  21. // LZHAM is in the Public Domain. Please see the Public Domain declaration at the end of include/lzham.h
  22. #include "lzham_core.h"
  23. -#ifdef __APPLE__
  24. +#ifdef ASSERT_USE_MIMALLOC
  25. + #include "mimalloc-override.h"
  26. +#elif defined(__APPLE__)
  27. #include <malloc/malloc.h>
  28. #elif defined(__FreeBSD__) || defined(__NetBSD__)
  29. #include <malloc_np.h>