diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-06-24 15:08:49 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2020-08-26 12:00:53 +0300 |
commit | 0fb7d5381ef29b837ea602e853d0fdc057da0e6c (patch) | |
tree | 7b85da506de110b50a77d6f031c707379131acc3 | |
parent | 7369a24f61cdf7afe0d930a422b6839919bc3b6d (diff) |
MEM_guardedalloc: allow freeing const arrays with MEM_SAFE_FREE
'const' arrays couldn't use this macro with GNUC.
-rw-r--r-- | intern/guardedalloc/MEM_guardedalloc.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/intern/guardedalloc/MEM_guardedalloc.h b/intern/guardedalloc/MEM_guardedalloc.h index d5b109ee59f..1af513e9264 100644 --- a/intern/guardedalloc/MEM_guardedalloc.h +++ b/intern/guardedalloc/MEM_guardedalloc.h @@ -204,7 +204,8 @@ extern size_t (*MEM_get_peak_memory)(void) ATTR_WARN_UNUSED_RESULT; do { \ typeof(&(v)) _v = &(v); \ if (*_v) { \ - MEM_freeN(*_v); \ + /* Cast so we can free constant arrays. */ \ + MEM_freeN((void *)*_v); \ *_v = NULL; \ } \ } while (0) |