SURFEX v8.1
General documentation of Surfex
intercept_alloc.h
Go to the documentation of this file.
1 #ifndef _INTERCEPT_ALLOC_H_
2 #define _INTERCEPT_ALLOC_H_
3 
4 /* intercept_alloc.h */
5 
6 #if defined(INTERCEPT_ALLOC)
7 
8 #if defined(RS6K) && defined(__64BIT__)
9 
10 #define EC_free __free
11 #define EC_malloc __malloc
12 #define EC_calloc __calloc
13 #define EC_realloc __realloc
14 #define EC_strdup __strdup
15 
16 #elif defined(NECSX)
17 /* Do nothing */
18 #else
19 /* Illegal to have -DINTERCEPT_ALLOC */
20 #undef INTERCEPT_ALLOC
21 #endif
22 
23 #endif
24 
25 #if defined(INTERCEPT_ALLOC)
26 
27 /* For reference, see also ifsaux/utilities/getcurheap.c */
28 
29 #define THEmalloc EC_malloc
30 extern void *EC_malloc(long long int size);
31 #define THEcalloc EC_calloc
32 extern void *EC_calloc(long long int nelem, long long int elsize);
33 #define THErealloc EC_realloc
34 extern void *EC_realloc(void *p, long long int size);
35 #define THEstrdup EC_strdup
36 extern char *EC_strdup(const char *s);
37 #define THEfree EC_free
38 extern void EC_free(void *p);
39 
40 #else /* i.e. !defined(INTERCEPT_ALLOC) */
41 
42 #define THEmalloc malloc
43 #define THEcalloc calloc
44 #define THErealloc realloc
45 #define THEstrdup strdup
46 #define THEfree free
47 
48 #endif
49 
50 #endif /* _INTERCEPT_ALLOC_H_ */
static long size
Definition: bytes_io.c:262
char * EC_strdup(const char *s)
Definition: getcurheap.c:521
void * EC_calloc(long long int nelem, long long int elsize)
Definition: getcurheap.c:490
void * EC_realloc(void *p, long long int size)
Definition: getcurheap.c:498
void EC_free(void *p)
Definition: getcurheap.c:315
void * EC_malloc(long long int size)
Definition: getcurheap.c:366