restore to old-style windows override; fix debug mode

This commit is contained in:
daan 2019-07-23 15:51:08 -07:00
commit dd79b662f8
5 changed files with 23 additions and 9 deletions

View file

@ -143,7 +143,11 @@ static size_t mi__msize_term(void* p) {
}
// Debug versions, forward to base versions (that get patched)
// Debug versions, forward to base versions in ucrtbase (that get patched)
void* _malloc_base(size_t size);
void* _calloc_base(size_t size, size_t count);
void* _realloc_base(void* p, size_t new_size);
void _free_base(void* p);
static void* mi__malloc_dbg(size_t size, int block_type, const char* fname, int line) {
UNUSED(block_type); UNUSED(fname); UNUSED(line);

View file

@ -9,7 +9,7 @@ terms of the MIT license. A copy of the license can be found in the file
#error "this file should be included from 'alloc.c' (so aliases can work)"
#endif
#if defined(MI_MALLOC_OVERRIDE) && defined(_WIN32) && !(defined(MI_SHARED_LIB) && defined(_DLL) && defined(_WIN64))
#if defined(MI_MALLOC_OVERRIDE) && defined(_WIN32) && !(defined(MI_SHARED_LIB) && defined(_DLL))
#error "It is only possible to override "malloc" on Windows when building as a 64-bit DLL (and linking the C runtime as a DLL)"
#endif

View file

@ -385,7 +385,7 @@ bool _mi_preloading() {
}
// Communicate with the redirection module on Windows
#if defined(_WIN32) && defined(MI_SHARED_LIB)
#if defined(_WIN32) && defined(XMI_SHARED_LIB)
#ifdef __cplusplus
extern "C" {
#endif