mem_alloc.h
1 #ifndef __mem_alloc_h
2 #define __mem_alloc_h
3 #include <stddef.h>
4 #include <stdlib.h>
5 #ifdef __linux__
6 #include <malloc.h>
7 #endif
8 #include "pll.h"
9 
10 #define rax_memalign memalign
11 #define rax_malloc malloc
12 #define rax_realloc realloc
13 #define rax_free free
14 #define rax_posix_memalign posix_memalign
15 #define rax_calloc calloc
16 //#define rax_malloc_aligned(x) memalign(PLL_BYTE_ALIGNMENT,x)
17 
18 //void *rax_memalign(size_t align, size_t size);
19 //void *rax_malloc(size_t size);
20 //void *rax_realloc(void *p, size_t size);
21 //void rax_free(void *p);
22 //int rax_posix_memalign(void **p, size_t align, size_t size);
23 //void *rax_calloc(size_t n, size_t size);
24 //
25 //void *rax_malloc_aligned(size_t size);
26 
27 
28 #if 0
29 // using the following contraption to trigger a compile-time error does not work on some gcc versions. It will trigger a confising linker error in the best case, so it is deativated.
30 
31 #if defined(RAXML_USE_LLALLOC) && !defined(MEM_ALLOC_NO_GUARDS)
32 #define malloc(x) XXX_DONT_USE_MALLOC_WITHOUT_RAX_PREFIX_XXX
33 #define free(x) XXX_DONT_USE_FREE_WITHOUT_RAX_PREFIX_XXX
34 #define calloc(x,y) XXX_DONT_USE_CALLOC_WITHOUT_RAX_PREFIX_XXX
35 #define realloc(x,y) XXX_DONT_USE_REALLOC_WITHOUT_RAX_PREFIX_XXX
36 #define malloc_aligned(x) XXX_DONT_USE_MALLOC_ALIGNED_WITHOUT_RAX_PREFIX_XXX
37 #define posix_memalign(x,y,z) XXX_DONT_USE_POSIX_MEMALIGN_ALIGNED_WITHOUT_RAX_PREFIX_XXX
38 #endif
39 #endif
40 
41 #endif
Data structures for tree and model.