Bug 1460720 Do not define _aligned_malloc - instead define _aligned_malloc_impl and export _aligned_malloc r=glandium
authorTom Ritter <tom@mozilla.com>
Tue, 15 May 2018 11:10:48 -0500
changeset 473047 144d50bc68914e2560e0fc22ba0fc445d0be6f8f
parent 473046 8d15ab11df3be633257f711341fde60da4d1e58d
child 473048 3da8ba2cf90e95ca5c2414940978e9ad1a5b97cc
push id9374
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:43:20 +0000
treeherdermozilla-beta@160e085dfb0b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1460720
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1460720 Do not define _aligned_malloc - instead define _aligned_malloc_impl and export _aligned_malloc r=glandium MozReview-Commit-ID: 3EwAd81Iz7r
memory/build/mozmemory_wrap.cpp
memory/build/mozmemory_wrap.h
mozglue/build/mozglue.def.in
--- a/memory/build/mozmemory_wrap.cpp
+++ b/memory/build/mozmemory_wrap.cpp
@@ -155,13 +155,13 @@ wcsdup_impl(const wchar_t* src)
   size_t len = wcslen(src);
   wchar_t* dst = (wchar_t*)malloc_impl((len + 1) * sizeof(wchar_t));
   if (dst)
     wcsncpy(dst, src, len + 1);
   return dst;
 }
 
 MOZ_MEMORY_API void*
-_aligned_malloc(size_t size, size_t alignment)
+_aligned_malloc_impl(size_t size, size_t alignment)
 {
   return memalign_impl(alignment, size);
 }
 #endif // XP_WIN
--- a/memory/build/mozmemory_wrap.h
+++ b/memory/build/mozmemory_wrap.h
@@ -151,16 +151,17 @@
 #define malloc_usable_size_impl mozmem_malloc_impl(malloc_usable_size)
 #define malloc_good_size_impl mozmem_malloc_impl(malloc_good_size)
 
 // Duplication functions
 #define strndup_impl mozmem_dup_impl(strndup)
 #define strdup_impl mozmem_dup_impl(strdup)
 #ifdef XP_WIN
 #define wcsdup_impl mozmem_dup_impl(wcsdup)
+#define _aligned_malloc_impl mozmem_dup_impl(_aligned_malloc)
 #endif
 
 // String functions
 #ifdef ANDROID
 // Bug 801571 and Bug 879668, libstagefright uses vasprintf, causing malloc()/
 // free() to be mismatched between bionic and mozglue implementation.
 #define vasprintf_impl mozmem_dup_impl(vasprintf)
 #define asprintf_impl mozmem_dup_impl(asprintf)
--- a/mozglue/build/mozglue.def.in
+++ b/mozglue/build/mozglue.def.in
@@ -10,15 +10,15 @@ EXPORTS
   malloc=je_malloc
   calloc=je_calloc
   realloc=je_realloc
   free=je_free
   posix_memalign=je_posix_memalign
   malloc_usable_size=je_malloc_usable_size
   malloc_good_size=je_malloc_good_size
   _aligned_free=je_free
-  _aligned_malloc
+  _aligned_malloc=wrap__aligned_malloc
   strndup=wrap_strndup
   strdup=wrap_strdup
   _strdup=wrap_strdup
   wcsdup=wrap_wcsdup
   _wcsdup=wrap_wcsdup
 #endif