summaryrefslogtreecommitdiffstats
path: root/libcxx/include/experimental/memory_resource
Commit message (Collapse)AuthorAgeFilesLines
* Revert "[coroutines] Add std::experimental::task<T> type"Brian Gesiak2019-03-261-0/+8
| | | | | | | | This revision is causing build and test failures, such as http://lab.llvm.org:8011/builders/libcxx-libcxxabi-libunwind-armv8-linux/builds/648/steps/test.libcxx/logs/stdio, so I'll revert it. llvm-svn: 357023
* [coroutines] Add std::experimental::task<T> typeBrian Gesiak2019-03-261-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Adds the coroutine `std::experimental::task<T>` type described in proposal P1056R0. See https://wg21.link/P1056R0. This implementation allows customization of the allocator used to allocate the coroutine frame by passing std::allocator_arg as the first argument, followed by the allocator to use. This supports co_awaiting the same task multiple times. The second and subsequent times it returns a reference to the already-computed value. This diff also adds some implementations of other utilities that have potential for standardization as helpers within the test/... area: - `sync_wait(awaitable)` - See P1171R0 - `manual_reset_event` Move the definition of the __aligned_allocation_size helper function from <experimental/memory_resource> to <experimental/__memory> so it can be more widely used without pulling in memory_resource. Outstanding work: - Use C++14 keywords directly rather than macro versions eg. use `noexcept` instead of `_NOEXCEPT`). - Add support for overaligned coroutine frames. This may need wording in the Coroutines TS to support passing the extra `std::align_val_t`. - Eliminate use of `if constexpr` if we want it to compile under C++14. Patch by @lewissbaker (Lewis Baker). llvm-svn: 357010
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. 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: 351636
* Move internal usages of `alignof`/`__alignof` to use `_LIBCPP_ALIGNOF`. Eric Fiselier2019-01-161-4/+4
| | | | | | | | | | | | | | | | | | | | | Summary: Starting in Clang 8.0 and GCC 8.0, `alignof` and `__alignof` return different values in same cases. Specifically `alignof` and `_Alignof` return the minimum alignment for a type, where as `__alignof` returns the preferred alignment. libc++ currently uses `__alignof` but means to use `alignof`. See llvm.org/PR39713 This patch introduces the macro `_LIBCPP_ALIGNOF` so we can control which spelling gets used. This patch does not introduce any ABI guard to provide the old behavior with newer compilers. However, if we decide that is needed, this patch makes it trivial to implement. I think we should commit this change immediately, and decide what we want to do about the ABI afterwards. Reviewers: ldionne, EricWF Reviewed By: ldionne, EricWF Subscribers: jyknight, christof, libcxx-commits Differential Revision: https://reviews.llvm.org/D54814 llvm-svn: 351289
* Remove unused code from __functional_base. NFC.Eric Fiselier2018-06-061-2/+2
| | | | | | | | | | | | | | Patch from Arthur O'Dwyer. `__user_alloc_construct_impl` is used by <experimental/memory_resource>, but this `__user_alloc_construct` is never used. Also, `<experimental/memory_resource>` doesn't need a full definition of `std::tuple`; just the forward declaration in `<__tuple>` will suffice. Reviewed as https://reviews.llvm.org/D46806 llvm-svn: 334069
* LWG 2969 "polymorphic_allocator::construct() shouldn't pass resource()"Eric Fiselier2018-05-291-11/+11
| | | | | | | | | | | | | | | | | | | Patch from Arthur O'Dwyer. In the TS, `uses_allocator` construction for `pair` tried to use an allocator type of `memory_resource*`, which is incorrect because `memory_resource*` is not an allocator type. LWG 2969 fixed it to use `polymorphic_allocator` as the allocator type instead. https://wg21.link/lwg2969 (D47090 included this in `<memory_resource>`; at Eric's request, I've split this out into its own patch applied to the existing `<experimental/memory_resource>` instead.) Reviewed as https://reviews.llvm.org/D47109 llvm-svn: 333384
* [Libc++] Use #pragma push_macro/pop_macro to better handle min/max on WindowsEric Fiselier2017-05-311-0/+5
| | | | | | | | | | | | | | | | Summary: This patch improves how libc++ handles min/max macros within the headers. Previously libc++ would undef them and emit a warning. This patch changes libc++ to use `#pragma push_macro` to save the macro before undefining it, and `#pragma pop_macro` to restore the macros and the end of the header. Reviewers: mclow.lists, bcraig, compnerd, EricWF Reviewed By: EricWF Subscribers: cfe-commits, krytarowski Differential Revision: https://reviews.llvm.org/D33080 llvm-svn: 304357
* remove max_size() extension from polymorphic_allocator. It is unneededEric Fiselier2017-03-021-6/+6
| | | | llvm-svn: 296831
* [NFC] Rename _LIBCPP_TYPE_VIS_ONLY to _LIBCPP_TEMPLATE_VISEric Fiselier2017-01-041-3/+3
| | | | | | | | | | | | | The name _LIBCPP_TYPE_VIS_ONLY is no longer accurate because both _LIBCPP_TYPE_VIS and _LIBCPP_TYPE_VIS_ONLY expand to __attribute__((__type_visibility__)) with Clang. The only remaining difference is that _LIBCPP_TYPE_VIS_ONLY can be applied to templates whereas _LIBCPP_TYPE_VIS cannot (due to dllimport/dllexport not being allowed on templates). This patch renames _LIBCPP_TYPE_VIS_ONLY to _LIBCPP_TEMPLATE_VIS. llvm-svn: 291035
* Followon to r279744. Find the other exception types and make __throw_XXX ↵Marshall Clow2016-08-251-4/+4
| | | | | | routines (and call them). Remove the generic __libcpp_throw routine, since no one uses it anymore. llvm-svn: 279763
* Implement p0337r0. Delete operator= for polymorphic_allocator.Eric Fiselier2016-06-271-1/+1
| | | | llvm-svn: 273838
* Add <experimental/memory_resource>Eric Fiselier2016-05-071-0/+422
Reviewers: mclow.lists, EricWF Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D20007 llvm-svn: 268829
OpenPOWER on IntegriCloud