From a9d3b9cbd1dbc2e702da7e45b3da3657a35a354c Mon Sep 17 00:00:00 2001 From: derrod Date: Mon, 27 Feb 2023 20:14:59 +0100 Subject: [PATCH] libobs: Clarify memalign ToDo item --- libobs/util/bmem.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/libobs/util/bmem.c b/libobs/util/bmem.c index dbe6fce9d..814c9da94 100644 --- a/libobs/util/bmem.c +++ b/libobs/util/bmem.c @@ -28,7 +28,16 @@ #define ALIGNMENT 32 -/* TODO: use memalign for non-windows systems */ +/* + * Attention, intrepid adventurers, exploring the depths of the libobs code! + * + * There used to be a TODO comment here saying that we should use memalign on + * non-Windows platforms. However, since *nix/POSIX systems do not provide an + * aligned realloc(), this is currently not (easily) achievable. + * So while the use of posix_memalign()/memalign() would be a fairly trivial + * change, it would also ruin our memory alignment for some reallocated memory + * on those platforms. + */ #if defined(_WIN32) #define ALIGNED_MALLOC 1 #else