Skip to content

Commit bbe782e

Browse files
dschoGit for Windows Build Agent
authored and
Git for Windows Build Agent
committed
fixup??? mimalloc: offer a build-time option to enable it
This is needed to ensure that the reftable tests have the correct idea which allocator to use. Suggested-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 7ad439b commit bbe782e

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

compat/posix.h

+10
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,16 @@ typedef unsigned long uintptr_t;
176176
#define _ALL_SOURCE 1
177177
#endif
178178

179+
#ifdef USE_MIMALLOC
180+
#include "mimalloc.h"
181+
#define malloc mi_malloc
182+
#define calloc mi_calloc
183+
#define realloc mi_realloc
184+
#define free mi_free
185+
#define strdup mi_strdup
186+
#define strndup mi_strndup
187+
#endif
188+
179189
#ifdef MKDIR_WO_TRAILING_SLASH
180190
#define mkdir(a,b) compat_mkdir_wo_trailing_slash((a),(b))
181191
int compat_mkdir_wo_trailing_slash(const char*, mode_t);

git-compat-util.h

-10
Original file line numberDiff line numberDiff line change
@@ -226,16 +226,6 @@ static inline const char *precompose_string_if_needed(const char *in)
226226
# include <sys/sysinfo.h>
227227
#endif
228228

229-
#ifdef USE_MIMALLOC
230-
#include "mimalloc.h"
231-
#define malloc mi_malloc
232-
#define calloc mi_calloc
233-
#define realloc mi_realloc
234-
#define free mi_free
235-
#define strdup mi_strdup
236-
#define strndup mi_strndup
237-
#endif
238-
239229
#ifndef PATH_SEP
240230
#define PATH_SEP ':'
241231
#endif

0 commit comments

Comments
 (0)