summaryrefslogtreecommitdiff
path: root/libcxxabi/test/test_fallback_malloc.pass.cpp
AgeCommit message (Collapse)Author
2024-02-05[libc++abi] Revert temporary workaround to unblock ChromeLouis Dionne
This reverts commit 372f7dd48f016, which is not needed by Chrome anymore.
2024-01-31[libc++abi] Add temporary workaround to unblock ChromeLouis Dionne
Chrome rolls libc++ and libc++abi as separate projects. As a result, they may not always be updated in lockstep, and this can lead to build failures when mixing libc++ that doesn't have <__thread/support.h> with libc++abi that requires it. This patch adds a workaround to make libc++abi work with both versions. While Chrome's setup is not supported, this workaround will allow them to go back to green and do the required work needed to roll libc++ and libc++abi in lockstep. This workaround will be short-lived -- I have a reminder to go back and remove it by EOW.
2024-01-30[libc++] Split the monolithic __threading_support header (#79654)Louis Dionne
The <__threading_support> header is a huge beast and it's really difficult to navigate. I find myself struggling to find what I want every time I have to open it, and I've been considering splitting it up for years for that reason. This patch aims not to contain any functional change. The various implementations of the threading base are simply moved to separate headers and then the individual headers are simplified in mechanical ways. For example, we used to have redundant declarations of all the functions at the top of `__threading_support`, and those are removed since they are not needed anymore. The various #ifdefs are also simplified and removed when they become unnecessary. Finally, this patch adds documentation for the API we expect from any threading implementation.
2023-11-23[libc++abi] Avoid raw calls to assert() in libc++abi (#71121)Louis Dionne
The runtimes now have a principled way of doing assertions in relation to hardening, so we should use that instead of raw calls to assert() inside libc++abi. This patch aims to maintain the behavior of the demangler code when it is used from within LLVM by introducing a simple DEMANGLE_ASSERT(...) macro that is then defined to the appropriate assertion mechanism.
2023-04-17[libcxxabi] [test] Use the correct printf formats for printing pointersMartin Storsjö
Don't cast the pointers to long, as that's not large enough for pointers on 64 bit Windows. Differential Revision: https://reviews.llvm.org/D147640
2023-01-26[libc++] Move the definition of aligned allocation helpers outside of <new>Louis Dionne
They are not needed in <new> -- in fact they are only needed in .cpp files. Getting those out of the way makes the headers smaller and also makes it easier to use the library on platforms where aligned allocation is not available. Differential Revision: https://reviews.llvm.org/D139231
2022-08-19[libcxxabi] Fix alignment of pointers returned by fallback_mallocSimon Tatham
This aligns the ``heap[]`` array in ``fallback_malloc.cpp`` to ensure that it can be safely cast to ``heap_node*``, and also adjusts the allocation algorithm to ensure that every allocated block has the alignment requested by ``__attribute__((aligned))``, by putting the block's ``heap_node`` header 4 bytes before an aligned address. Patch originally by Eric Fiselier: this is an updated version of D12669, which was never landed. Reviewed By: ldionne, #libc_abi Differential Revision: https://reviews.llvm.org/D129842
2022-05-27[runtimes] Rename various libcpp-has-no-XYZ Lit features to just no-XYZLouis Dionne
Since those features are general properties of the environment, it makes sense to use them from libc++abi too, and so the name libcpp-has-no-xxx doesn't make sense. Differential Revision: https://reviews.llvm.org/D126482
2022-05-26[libc++abi] Use from-scratch testing configs for libc++abi by defaultLouis Dionne
Like we have been doing for libc++ for a while now, start using from-scratch testing configurations for libc++abi. As a fly-by fix, remove the LIBCXXABI_NO_TIMER macro, which was defined but never used. Differential Revision: https://reviews.llvm.org/D125242
2022-03-01[libc++] Revert "Protect users from relying on detail headers" & related changesLouis Dionne
This commit reverts 5aaefa51 (and also partly 7f285f48e77 and b6d75682f9, which were related to the original commit). As landed, 5aaefa51 had unintended consequences on some downstream bots and didn't have proper coverage upstream due to a few subtle things. Implementing this is something we should do in libc++, however we'll first need to address a few issues listed in https://reviews.llvm.org/D106124#3349710. Differential Revision: https://reviews.llvm.org/D120683
2022-02-26[libcxx][modules] protects users from relying on detail headersChristopher Di Bella
libc++ has started splicing standard library headers into much more fine-grained content for maintainability. It's very likely that outdated and naive tooling (some of which is outside of LLVM's scope) will suggest users include things such as <__ranges/access.h> instead of <ranges>, and Hyrum's law suggests that users will eventually begin to rely on this without the help of tooling. As such, this commit intends to protect users from themselves, by making it a hard error for anyone outside of the standard library to include libc++ detail headers. Differential Revision: https://reviews.llvm.org/D106124
2021-11-17[runtimes][NFC] Remove filenames at the top of the license noticeLouis Dionne
We've stopped doing it in libc++ for a while now because these names would end up rotting as we move things around and copy/paste stuff. This cleans up all the existing files so as to stop the spreading as people copy-paste headers around.
2020-10-16[libcxxabi] Fix printf formats in a test.Simon Tatham
This is the libcxxabi counterpart of D89545, and would have been part of that patch if I'd spotted it soon enough (oops). One test in libcxxabi is using the `%lu` printf format to refer to `size_t`, which should be `%zu`. Reviewed By: ldionne, #libc_abi Differential Revision: https://reviews.llvm.org/D89547
2020-10-13[libc++/abi] Clean up uses of <iostream> in the test suiteLouis Dionne
We used <iostream> in several places where we don't actually need the full power of <iostream>, and where using basic `std::printf` is enough. This is better, since `std::printf` can be supported on systems that don't have a notion of locales, while <iostream> can't.
2019-01-19Update more file headers across all of the LLVM projects in the monorepoChandler Carruth
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
2017-01-03[libcxxabi] Introduce an externally threaded libc++abi variant.Asiri Rathnayake
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
2016-12-24Fix warnings in libc++abi testsEric Fiselier
llvm-svn: 290471
2016-10-13[libcxxabi] Refactor pthread usage into a separate APIAsiri Rathnayake
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
2016-10-07Recommit r282692: [libc++abi] Use fallback_malloc to allocate ↵Igor Kudrin
__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
2016-09-29Revert r282692: Use fallback_malloc to allocate __cxa_eh_globals in case of ↵Igor Kudrin
dynamic memory exhaustion. The test breaks build bots. llvm-svn: 282703
2016-09-29[libc++abi] Use fallback_malloc to allocate __cxa_eh_globals in case of ↵Igor Kudrin
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
2015-01-21Rename all of the tests in preparation for merging lit configs with libcxxJonathan Roelofs
http://reviews.llvm.org/D7101 llvm-svn: 226691