Igor Kudrin | 11741ce | 2016-10-07 08:48:28 +0000 | [diff] [blame] | 1 | //===------------------------- fallback_malloc.h --------------------------===// |
| 2 | // |
Chandler Carruth | 8ee27c3 | 2019-01-19 10:56:40 +0000 | [diff] [blame] | 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
Igor Kudrin | 11741ce | 2016-10-07 08:48:28 +0000 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
| 9 | #ifndef _FALLBACK_MALLOC_H |
| 10 | #define _FALLBACK_MALLOC_H |
| 11 | |
Shoaib Meenai | a992117 | 2017-03-01 03:55:57 +0000 | [diff] [blame] | 12 | #include "__cxxabi_config.h" |
Louis Dionne | f997cb6 | 2019-10-01 18:43:02 +0000 | [diff] [blame] | 13 | #include <stddef.h> // for size_t |
Igor Kudrin | 11741ce | 2016-10-07 08:48:28 +0000 | [diff] [blame] | 14 | |
| 15 | namespace __cxxabiv1 { |
| 16 | |
Igor Kudrin | 11741ce | 2016-10-07 08:48:28 +0000 | [diff] [blame] | 17 | // Allocate some memory from _somewhere_ |
Eric Fiselier | be1d349 | 2017-03-04 02:04:45 +0000 | [diff] [blame] | 18 | _LIBCXXABI_HIDDEN void * __aligned_malloc_with_fallback(size_t size); |
Igor Kudrin | 11741ce | 2016-10-07 08:48:28 +0000 | [diff] [blame] | 19 | |
| 20 | // Allocate and zero-initialize memory from _somewhere_ |
Shoaib Meenai | a992117 | 2017-03-01 03:55:57 +0000 | [diff] [blame] | 21 | _LIBCXXABI_HIDDEN void * __calloc_with_fallback(size_t count, size_t size); |
Igor Kudrin | 11741ce | 2016-10-07 08:48:28 +0000 | [diff] [blame] | 22 | |
Eric Fiselier | be1d349 | 2017-03-04 02:04:45 +0000 | [diff] [blame] | 23 | _LIBCXXABI_HIDDEN void __aligned_free_with_fallback(void *ptr); |
Shoaib Meenai | a992117 | 2017-03-01 03:55:57 +0000 | [diff] [blame] | 24 | _LIBCXXABI_HIDDEN void __free_with_fallback(void *ptr); |
Igor Kudrin | 11741ce | 2016-10-07 08:48:28 +0000 | [diff] [blame] | 25 | |
| 26 | } // namespace __cxxabiv1 |
| 27 | |
| 28 | #endif |