From 068bb052b2549e4169630e0e10dbbf084253eb0e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 23 Jul 2024 15:55:12 +1000 Subject: [PATCH] Cleanup: use const variables in mallocn reporting --- intern/guardedalloc/intern/mallocn_lockfree_impl.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/intern/guardedalloc/intern/mallocn_lockfree_impl.cc b/intern/guardedalloc/intern/mallocn_lockfree_impl.cc index 5b18040c19e..30c4c57c5bf 100644 --- a/intern/guardedalloc/intern/mallocn_lockfree_impl.cc +++ b/intern/guardedalloc/intern/mallocn_lockfree_impl.cc @@ -118,13 +118,13 @@ report_error_on_address(const void *vmemh, const char *message, ...) return; } - MemHead *memh = MEMHEAD_FROM_PTR(vmemh); - size_t len = MEMHEAD_LEN(memh); + const MemHead *memh = MEMHEAD_FROM_PTR(vmemh); + const size_t len = MEMHEAD_LEN(memh); - void *address = memh; + const void *address = memh; size_t size = len + sizeof(*memh); if (UNLIKELY(MEMHEAD_IS_ALIGNED(memh))) { - MemHeadAligned *memh_aligned = MEMHEAD_ALIGNED_FROM_PTR(vmemh); + const MemHeadAligned *memh_aligned = MEMHEAD_ALIGNED_FROM_PTR(vmemh); address = MEMHEAD_REAL_PTR(memh_aligned); size = len + sizeof(*memh_aligned) + MEMHEAD_ALIGN_PADDING(memh_aligned->alignment); }