From 03b3291d3f935b87789bb71e1eedf4278bce097c Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Mon, 12 Jan 2015 12:20:56 +0900 Subject: [PATCH] Bug 1120272 - Expose _aligned_alloc and _aligned_free from mozglue. r=njn --- memory/build/mozmemory_wrap.c | 6 ++++++ mozglue/build/mozglue.def.in | 3 +++ 2 files changed, 9 insertions(+) diff --git a/memory/build/mozmemory_wrap.c b/memory/build/mozmemory_wrap.c index ad7a1d0091fa..dba3ace56395 100644 --- a/memory/build/mozmemory_wrap.c +++ b/memory/build/mozmemory_wrap.c @@ -169,4 +169,10 @@ wcsdup_impl(const wchar_t *src) wcsncpy(dst, src, len + 1); return dst; } + +void * +_aligned_malloc(size_t size, size_t alignment) +{ + return memalign_impl(alignment, size); +} #endif /* XP_WIN */ diff --git a/mozglue/build/mozglue.def.in b/mozglue/build/mozglue.def.in index d086b9727bd2..62eb3caed485 100644 --- a/mozglue/build/mozglue.def.in +++ b/mozglue/build/mozglue.def.in @@ -15,6 +15,7 @@ EXPORTS 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 @@ -23,7 +24,9 @@ EXPORTS 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