Skip to content

Commit 2c2931a

Browse files
committed
Fix #if defined(USE_JEMALLOC) && (USE_JEMALLOC)
1 parent 0580cdf commit 2c2931a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Common/Allocator.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <pcg_random.hpp>
1212
#include <Common/thread_local_rng.h>
1313

14-
#if USE_JEMALLOC
14+
#if defined(USE_JEMALLOC) && (USE_JEMALLOC)
1515
# include <jemalloc/jemalloc.h>
1616
#else
1717
# if !defined(OS_DARWIN) && !defined(OS_FREEBSD)
@@ -134,7 +134,7 @@ class Allocator
134134
{
135135
/// Resize malloc'd memory region with no special alignment requirement.
136136
CurrentMemoryTracker::realloc(old_size, new_size);
137-
#if USE_JEMALLOC
137+
#if defined(USE_JEMALLOC) && (USE_JEMALLOC)
138138
void * new_buf = je_realloc(buf, new_size);
139139
#else
140140
void * new_buf = ::realloc(buf, new_size);
@@ -228,7 +228,7 @@ class Allocator
228228
{
229229
if (alignment <= MALLOC_MIN_ALIGNMENT)
230230
{
231-
#if USE_JEMALLOC
231+
#if defined(USE_JEMALLOC) && (USE_JEMALLOC)
232232
if constexpr (clear_memory)
233233
buf = je_calloc(size, 1);
234234
else
@@ -267,7 +267,7 @@ class Allocator
267267
}
268268
else
269269
{
270-
#if USE_JEMALLOC
270+
#if defined(USE_JEMALLOC) && (USE_JEMALLOC)
271271
je_free(buf);
272272
#else
273273
::free(buf);

0 commit comments

Comments
 (0)