summaryrefslogtreecommitdiffstats
path: root/libcxxabi/src/fallback_malloc.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [libcxx{,abi}] Emit deplibs only when detected by CMakeMichał Górny2019-12-021-1/+1
| | | | | | | | This is a followup to 35bc5276ca3. It fixes the dependent libs usage in libcxx and libcxxabi to link pthread and rt libraries only if CMake detects them, rather than based on explicit platform blacklist. Differential Revision: https://reviews.llvm.org/D70888
* [libc++abi] Remove uses of C++ headers when possibleLouis Dionne2019-10-011-7/+7
| | | | | | | | | | This reduces the (circular) dependency of libc++abi on a C++ standard library. Outside of the demangler which uses fancier C++ features, the only C++ headers now required by libc++abi are pretty much <new> and <exception>, and that's because libc++abi defines some types that are declared in those headers. llvm-svn: 373381
* [runtimes] Don't depend on libpthread on AndroidYi Kong2019-07-221-1/+1
| | | | | | | | | | r362048 added support for ELF dependent libraries, but broke Android build since Android does not have libpthread. Remove the dependency on the Android build. Differential Revision: https://reviews.llvm.org/D65098 llvm-svn: 366734
* [runtimes] Check if pragma comment(lib, ...) is supported firstPetr Hosek2019-05-301-1/+1
| | | | | | | | | This fixes the issue introduced by r362048 where we always use pragma comment(lib, ...) for dependent libraries when the compiler is Clang, but older Clang versions don't support this pragma so we need to check first if it's supported before using it. llvm-svn: 362055
* [runtimes] Support ELF dependent libraries featurePetr Hosek2019-05-301-0/+5
| | | | | | | | | | | | | | | | | | | As of r360984, LLD supports dependent libraries feature for ELF. libunwind, libc++abi and libc++ have library dependencies: libdl librt and libpthread, which means that when libunwind and libc++ are being statically linked (using -static-libstdc++ flag), user has to manually specify -ldl -lpthread which is onerous. This change includes the lib pragma to specify the library dependencies directly in the source that uses those libraries. This doesn't make any difference when using linkers that don't support dependent libraries. However, when using LLD that has dependent libraries feature, users no longer have to manually specifying library dependencies when using static linking, linker will pick the library automatically. Differential Revision: https://reviews.llvm.org/D62090 llvm-svn: 362048
* Update more file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | | to reflect the new license. These used slightly different spellings that defeated my regular expressions. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351648
* Use C++03 friendly version of alignofEric Fiselier2018-10-111-1/+1
| | | | llvm-svn: 344215
* Update libc++abi's detection of aligned allocation after r344207.Eric Fiselier2018-10-111-2/+2
| | | | llvm-svn: 344208
* Fix incorrectly aligned exceptions in 32 bit builds.Eric Fiselier2018-09-221-0/+3
| | | | | | | | | | | | | | | | | This patch fixes a bug where exceptions in 32 bit builds would be incorrectly aligned because malloc only provides 8 byte aligned memory where 16 byte alignment is needed. This patch makes libc++abi correctly use posix_memalign when it's available. This requires defining _LIBCPP_BUILDING_LIBRARY so that libc++ only defines _LIBCPP_HAS_NO_ALIGNED_ALLOCATION when libc doesn't support it and not when aligned new/delete are disable for other reasons. This bug somehow made it into the 7.0 release, making it a regression. Therefore this patch should be included in the next dot release. llvm-svn: 342815
* [libc++abi] Delete config.hShoaib Meenai2017-03-301-1/+0
| | | | | | | | | | | | Summary: It's now completely empty, so we can remove it entirely. Reviewers: mclow.lists, EricWF Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D31502 llvm-svn: 299129
* Fully Reformat fallback_malloc.cppEric Fiselier2017-03-041-140/+146
| | | | | | | | | | | | This patch fully reformats fallback_malloc.cpp. Previously the test was a mess of different styles and indentations. This made it very hard to work in and read. Therefore I felt it was best to re-format the whole thing. Unfortuantly this means some history will be lost, but hopefully much of it will still be accessible after ignoring whitespace changes. llvm-svn: 296960
* [libcxxabi] Fix alignment of allocated exceptions in 32 bit buildsEric Fiselier2017-03-041-5/+30
| | | | | | | | | | | | | | | | | 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 llvm-svn: 296952
* [libc++abi] Clean up visibilityShoaib Meenai2017-03-011-4/+0
| | | | | | | | | | | | | | | | | Use the libc++abi visibility macros instead of pragmas or using visibility attributes directly. Clean up redundant attributes on definitions (where the declarations already have visibility attributes applied, from either libc++ or libc++abi headers). Introduce _LIBCXXABI_WEAK as a drive-by cleanup, which matches the semantics of _LIBCPP_WEAK. No functional change. Tested by building on Linux before and after this change and verifying that the list of exported symbols is identical. Differential Revision: https://reviews.llvm.org/D26949 llvm-svn: 296576
* [libcxxabi] Introduce an externally threaded libc++abi variant.Asiri Rathnayake2017-01-031-6/+9
| | | | | | | | | | r281179 Introduced an externally threaded variant of the libc++ library. This patch adds support for a similar library variant for libc++abi. Differential revision: https://reviews.llvm.org/D27575 Reviewers: EricWF llvm-svn: 290888
* [libcxxabi] Refactor pthread usage into a separate APIAsiri Rathnayake2016-10-131-8/+5
| | | | | | | | | | | | | | | | | | This patch refactors all pthread uses of libc++abi into a separate API. This is the first step towards supporting an externlly-threaded libc++abi library. I've followed the conventions already used in the libc++ library for the same purpose. Patch from: Saleem Abdulrasool and Asiri Rathnayake Reviewed by: compnerd, EricWF Differential revisions: https://reviews.llvm.org/D18482 (original) https://reviews.llvm.org/D24864 (final) llvm-svn: 284128
* Recommit r282692: [libc++abi] Use fallback_malloc to allocate ↵Igor Kudrin2016-10-071-0/+226
| | | | | | | | | | | | | | | | | __cxa_eh_globals in case of dynamic memory exhaustion. Throwing an exception for the first time may lead to call calloc to allocate memory for __cxa_eh_globals. If the memory pool is exhausted at that moment, it results in abnormal termination of the program. This patch addresses the issue by using fallback_malloc in that case. In this revision, some restrictions were added into the test to not run it in unsuitable environments. Differential Revision: https://reviews.llvm.org/D17815 llvm-svn: 283531
* Revert r282692: Use fallback_malloc to allocate __cxa_eh_globals in case of ↵Igor Kudrin2016-09-291-226/+0
| | | | | | | | dynamic memory exhaustion. The test breaks build bots. llvm-svn: 282703
* [libc++abi] Use fallback_malloc to allocate __cxa_eh_globals in case of ↵Igor Kudrin2016-09-291-0/+226
| | | | | | | | | | | | | | dynamic memory exhaustion. Throwing an exception for the first time may lead to call calloc to allocate memory for __cxa_eh_globals. If the memory pool is exhausted at that moment, it results in abnormal termination of the program. This patch addresses the issue by using fallback_malloc in that case. Differential Revision: https://reviews.llvm.org/D17815 llvm-svn: 282692
* Got fooled by fallback_malloc.cpp source file: it is really a private ↵Howard Hinnant2012-01-241-177/+0
| | | | | | header. I've manually included it into the only place it is used: cxa_exception.cpp. llvm-svn: 148854
* Added missing #includeHoward Hinnant2012-01-231-0/+2
| | | | llvm-svn: 148749
* Updated commentsMarshall Clow2011-07-251-2/+2
| | | | llvm-svn: 135909
* Added copyright headerMarshall Clow2011-07-201-0/+14
| | | | llvm-svn: 135601
* Memory manangement routines for exception objectsMarshall Clow2011-07-201-0/+161
llvm-svn: 135587
OpenPOWER on IntegriCloud