Bug 1120272 - Expose _aligned_alloc and _aligned_free from mozglue. r=njn
authorMike Hommey <mh+mozilla@glandium.org>
Mon, 12 Jan 2015 12:20:56 +0900
changeset 253376 93f526d85b47667c6f3721294fffcd1e9d09b224
parent 253375 42df041f636cf27e8fc662ff33aa91a1f78e8ad2
child 253399 3803a1420b1d92b2e65cc5163a9e48f702f60980
child 253460 dbdbade50ffacc23c85b5ed1b85b011c9227f4b3
push id721
push userjlund@mozilla.com
push dateTue, 21 Apr 2015 23:03:33 +0000
treeherdermozilla-release@d27c9211ebb3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnjn
bugs1120272
milestone38.0a1
first release with
nightly linux32
93f526d85b47 / 38.0a1 / 20150120030203 / files
nightly linux64
93f526d85b47 / 38.0a1 / 20150120030203 / files
nightly mac
93f526d85b47 / 38.0a1 / 20150120030203 / files
nightly win32
93f526d85b47 / 38.0a1 / 20150120030203 / files
nightly win64
93f526d85b47 / 38.0a1 / 20150120030203 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1120272 - Expose _aligned_alloc and _aligned_free from mozglue. r=njn
memory/build/mozmemory_wrap.c
mozglue/build/mozglue.def.in
--- a/memory/build/mozmemory_wrap.c
+++ b/memory/build/mozmemory_wrap.c
@@ -164,9 +164,15 @@ wchar_t *
 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;
 }
+
+void *
+_aligned_malloc(size_t size, size_t alignment)
+{
+  return memalign_impl(alignment, size);
+}
 #endif /* XP_WIN */
--- a/mozglue/build/mozglue.def.in
+++ b/mozglue/build/mozglue.def.in
@@ -10,25 +10,28 @@ EXPORTS
 #ifdef MOZ_REPLACE_MALLOC
   malloc=malloc_impl
   calloc=calloc_impl
   realloc=realloc_impl
   free=free_impl
   posix_memalign=posix_memalign_impl
   malloc_usable_size=malloc_usable_size_impl
   malloc_good_size=malloc_good_size_impl
+  _aligned_free=free_impl
 #else
   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
 #endif
+  _aligned_malloc
   strndup=wrap_strndup
   strdup=wrap_strdup
   _strdup=wrap_strdup
   wcsdup=wrap_wcsdup
   _wcsdup=wrap_wcsdup
   jemalloc_stats
   jemalloc_free_dirty_pages
   ; A hack to work around the CRT (see giant comment in Makefile.in)