summaryrefslogtreecommitdiff
path: root/src/fallback_malloc.h
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2017-03-04 02:04:45 +0000
committerEric Fiselier <eric@efcs.ca>2017-03-04 02:04:45 +0000
commitaad059409f93f48058f669d730cb35ad7b84bb69 (patch)
tree9ed81b7357634d43cfdd134cb1f915e75de2daac /src/fallback_malloc.h
parentda7d616fd2870e097eaa85bcec38b97a6d6dbde2 (diff)
[libcxxabi] Fix alignment of allocated exceptions in 32 bit builds
Summary: In 32 bit builds on a 64 bit system `std::malloc` does not return correctly aligned memory. This leads to undefined behavior. This patch switches to using `posix_memalign` to allocate correctly aligned memory instead. Reviewers: mclow.lists, danalbert, jroelofs, compnerd Reviewed By: compnerd Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25417 git-svn-id: https://llvm.org/svn/llvm-project/libcxxabi/trunk@296952 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'src/fallback_malloc.h')
-rw-r--r--src/fallback_malloc.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/fallback_malloc.h b/src/fallback_malloc.h
index cb2c843..d6f4714 100644
--- a/src/fallback_malloc.h
+++ b/src/fallback_malloc.h
@@ -16,11 +16,12 @@
namespace __cxxabiv1 {
// Allocate some memory from _somewhere_
-_LIBCXXABI_HIDDEN void * __malloc_with_fallback(size_t size);
+_LIBCXXABI_HIDDEN void * __aligned_malloc_with_fallback(size_t size);
// Allocate and zero-initialize memory from _somewhere_
_LIBCXXABI_HIDDEN void * __calloc_with_fallback(size_t count, size_t size);
+_LIBCXXABI_HIDDEN void __aligned_free_with_fallback(void *ptr);
_LIBCXXABI_HIDDEN void __free_with_fallback(void *ptr);
} // namespace __cxxabiv1