source: tags/ms_r16q2/CORE/arb_mem.h

Last change on this file was 12973, checked in by westram, 10 years ago
  • [12967] got reverted by 'make proto'. fixed.
File size: 1.0 KB
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
18int arb_alloc_aligned_intern(void **tgt, size_t len);
19
20/* allocate 16 byte aligned memory and export error on failure */
21template<class TYPE>
22inline 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.