1 | // This file is part of Eigen, a lightweight C++ template library |
---|
2 | // for linear algebra. |
---|
3 | // |
---|
4 | // Copyright (C) 2011 Benoit Jacob <jacob.benoit.1@gmail.com> |
---|
5 | // |
---|
6 | // This Source Code Form is subject to the terms of the Mozilla |
---|
7 | // Public License v. 2.0. If a copy of the MPL was not distributed |
---|
8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. |
---|
9 | |
---|
10 | #ifndef EIGEN2_MEMORY_H |
---|
11 | #define EIGEN2_MEMORY_H |
---|
12 | |
---|
13 | namespace Eigen { |
---|
14 | |
---|
15 | inline void* ei_aligned_malloc(size_t size) { return internal::aligned_malloc(size); } |
---|
16 | inline void ei_aligned_free(void *ptr) { internal::aligned_free(ptr); } |
---|
17 | inline void* ei_aligned_realloc(void *ptr, size_t new_size, size_t old_size) { return internal::aligned_realloc(ptr, new_size, old_size); } |
---|
18 | inline void* ei_handmade_aligned_malloc(size_t size) { return internal::handmade_aligned_malloc(size); } |
---|
19 | inline void ei_handmade_aligned_free(void *ptr) { internal::handmade_aligned_free(ptr); } |
---|
20 | |
---|
21 | template<bool Align> inline void* ei_conditional_aligned_malloc(size_t size) |
---|
22 | { |
---|
23 | return internal::conditional_aligned_malloc<Align>(size); |
---|
24 | } |
---|
25 | template<bool Align> inline void ei_conditional_aligned_free(void *ptr) |
---|
26 | { |
---|
27 | internal::conditional_aligned_free<Align>(ptr); |
---|
28 | } |
---|
29 | template<bool Align> inline void* ei_conditional_aligned_realloc(void* ptr, size_t new_size, size_t old_size) |
---|
30 | { |
---|
31 | return internal::conditional_aligned_realloc<Align>(ptr, new_size, old_size); |
---|
32 | } |
---|
33 | |
---|
34 | template<typename T> inline T* ei_aligned_new(size_t size) |
---|
35 | { |
---|
36 | return internal::aligned_new<T>(size); |
---|
37 | } |
---|
38 | template<typename T> inline void ei_aligned_delete(T *ptr, size_t size) |
---|
39 | { |
---|
40 | return internal::aligned_delete(ptr, size); |
---|
41 | } |
---|
42 | |
---|
43 | } // end namespace Eigen |
---|
44 | |
---|
45 | #endif // EIGEN2_MACROS_H |
---|