From 07ef553414863e2f7cf63701c7223d454917c613 Mon Sep 17 00:00:00 2001 From: Andreas Brykt Date: Fri, 26 Jan 2024 17:04:13 +0100 Subject: [PATCH] Add JUCE_NO_DEPRECATED_HEAPBLOCK_METHODS to optionally remove deprecated HeapBlock methods --- modules/juce_core/memory/juce_HeapBlock.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/juce_core/memory/juce_HeapBlock.h b/modules/juce_core/memory/juce_HeapBlock.h index 93cc67d26003..f756410391c2 100644 --- a/modules/juce_core/memory/juce_HeapBlock.h +++ b/modules/juce_core/memory/juce_HeapBlock.h @@ -294,6 +294,8 @@ class HeapBlock data = nullptr; } +#ifndef JUCE_NO_DEPRECATED_HEAPBLOCK_METHODS + template [[deprecated]] void malloc(SizeType newNumElements, size_t elementSize = sizeof(ElementType)) { return jmalloc(newNumElements, elementSize); @@ -326,6 +328,8 @@ class HeapBlock jfree(); } +#endif + /** Swaps this object's data with the data of another HeapBlock. The two objects simply exchange their data pointers. */