From 1c3487444c2fda3c4621999243df333281e2ed6d Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 20 Sep 2019 13:17:19 +0200 Subject: [PATCH] - some safety net. --- source/build/include/compat.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/build/include/compat.h b/source/build/include/compat.h index 6ecf58579..dea2a1943 100644 --- a/source/build/include/compat.h +++ b/source/build/include/compat.h @@ -918,7 +918,7 @@ static FORCE_INLINE void *Baligned_alloc(const size_t alignment, const size_t si #if defined _WIN32 && !defined NO_ALIGNED_MALLOC # define Baligned_free _aligned_free #else -# define Baligned_free Xfree +# define Baligned_free xfree() #endif @@ -1305,6 +1305,9 @@ static FORCE_INLINE void *xrealloc(void * const ptr, const bsize_t size) return (EDUKE32_PREDICT_TRUE(newptr != NULL || size == 0)) ? newptr: handle_memerr(ptr); } +// This will throw up when BFee is no longer usable, I do not want to change all code right now that uses it to make future merges easier. +static_assert(Bfree == free, "BFree must be free"); + static FORCE_INLINE void xfree(void *const ptr) { Bfree(ptr); } static FORCE_INLINE void xaligned_free(void *const ptr) { Baligned_free(ptr); }