diff --git a/memory/build/mozjemalloc.cpp b/memory/build/mozjemalloc.cpp index 196c3259bea6..d3f1f8c5f878 100644 --- a/memory/build/mozjemalloc.cpp +++ b/memory/build/mozjemalloc.cpp @@ -4851,7 +4851,7 @@ MOZ_EXPORT void* (*__memalign_hook)(size_t, size_t) = memalign_impl; #endif #ifdef XP_WIN -void* _recalloc(void* aPtr, size_t aCount, size_t aSize) { +MOZ_EXPORT void* _recalloc(void* aPtr, size_t aCount, size_t aSize) { size_t oldsize = aPtr ? AllocInfo::Get(aPtr).Size() : 0; CheckedInt checkedSize = CheckedInt(aCount) * aSize; @@ -4876,7 +4876,7 @@ void* _recalloc(void* aPtr, size_t aCount, size_t aSize) { // This impl of _expand doesn't ever actually expand or shrink blocks: it // simply replies that you may continue using a shrunk block. -void* _expand(void* aPtr, size_t newsize) { +MOZ_EXPORT void* _expand(void* aPtr, size_t newsize) { if (AllocInfo::Get(aPtr).Size() >= newsize) { return aPtr; } @@ -4884,5 +4884,7 @@ void* _expand(void* aPtr, size_t newsize) { return nullptr; } -size_t _msize(void* aPtr) { return DefaultMalloc::malloc_usable_size(aPtr); } +MOZ_EXPORT size_t _msize(void* aPtr) { + return DefaultMalloc::malloc_usable_size(aPtr); +} #endif diff --git a/third_party/sqlite3/src/moz.build b/third_party/sqlite3/src/moz.build index b152b0e30df0..54572d20f5f4 100644 --- a/third_party/sqlite3/src/moz.build +++ b/third_party/sqlite3/src/moz.build @@ -67,11 +67,10 @@ if CONFIG['OS_TARGET'] == 'Android': # default to user readable only to fit Android security model DEFINES['SQLITE_DEFAULT_FILE_PERMISSIONS'] = '0600' -# Force using malloc_usable_size when building with jemalloc because _msize -# causes assertions on Win64. See bug 719579. -if CONFIG['OS_ARCH'] == 'WINNT' and CONFIG['MOZ_MEMORY']: - DEFINES['HAVE_MALLOC_USABLE_SIZE'] = True - DEFINES['SQLITE_WITHOUT_MSIZE'] = True +# Force using _msize on mingw, as sqlite3 only enables it with MSVC. +if CONFIG['OS_TARGET'] == 'WINNT' and CONFIG['CC_TYPE'] != 'clang-cl': + DEFINES['SQLITE_USE_MALLOC_H'] = True + DEFINES['SQLITE_USE_MSIZE'] = True # Omit unused functions to save some library footprint. DEFINES['SQLITE_OMIT_DEPRECATED'] = True