Line | |
---|
1 | // ================================================================= // |
---|
2 | // // |
---|
3 | // File : arb_mem.h // |
---|
4 | // Purpose : // |
---|
5 | // // |
---|
6 | // Coded by Elmar Pruesse in September 2014 // |
---|
7 | // http://www.arb-home.de/ // |
---|
8 | // // |
---|
9 | // ================================================================= // |
---|
10 | |
---|
11 | #ifndef ARB_MEM_H |
---|
12 | #define ARB_MEM_H |
---|
13 | |
---|
14 | #ifndef _GLIBCXX_CSTDLIB |
---|
15 | #include <cstdlib> |
---|
16 | #endif |
---|
17 | |
---|
18 | int arb_alloc_aligned_intern(void **tgt, size_t len); |
---|
19 | |
---|
20 | /* allocate 16 byte aligned memory and export error on failure */ |
---|
21 | template<class TYPE> |
---|
22 | inline int arb_alloc_aligned(TYPE*& tgt, size_t len) { |
---|
23 | return arb_alloc_aligned_intern((void**)&tgt, len * sizeof(TYPE)); |
---|
24 | } |
---|
25 | |
---|
26 | #else |
---|
27 | #error arb_mem.h included twice |
---|
28 | #endif // ARB_MEM_H |
---|
Note: See
TracBrowser
for help on using the repository browser.