CUBRID Engine  latest
heaplayers.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 
3 /*
4 
5  Heap Layers: An Extensible Memory Allocation Infrastructure
6 
7  Copyright (C) 2000-2020 by Emery Berger
8  http://www.emeryberger.com
9  emery@cs.umass.edu
10 
11  Heap Layers is distributed under the terms of the Apache 2.0 license.
12 
13  You may obtain a copy of the License at
14  http://www.apache.org/licenses/LICENSE-2.0
15 
16 */
17 
29 #ifndef HL_HEAPLAYERS_H
30 #define HL_HEAPLAYERS_H
31 
32 #include <assert.h>
33 
34 namespace HL {}
35 
36 // Define HL_EXECUTABLE_HEAP as 1 if you want that (i.e., you're doing
37 // dynamic code generation).
38 
39 #define HL_EXECUTABLE_HEAP 1
40 
41 #if defined(_MSC_VER)
42 
43 // Microsoft Visual Studio
44 #pragma inline_depth(255)
45 #define INLINE __forceinline
46 //#define inline __forceinline
47 #define NO_INLINE __declspec(noinline)
48 #pragma warning(disable: 4530)
49 #define MALLOC_FUNCTION
50 #define RESTRICT
51 
52 #elif defined(__GNUC__)
53 
54 // GNU C
55 
56 #define NO_INLINE __attribute__ ((noinline))
57 #define INLINE inline
58 #define MALLOC_FUNCTION __attribute__((malloc))
59 #define RESTRICT __restrict__
60 
61 #else
62 
63 // All others
64 
65 #define NO_INLINE
66 #define INLINE inline
67 #define MALLOC_FUNCTION
68 #define RESTRICT
69 
70 #endif
71 
72 
85 #ifndef ALLOCATION_STATS
86 #define ALLOCATION_STATS 0
87 #endif
88 
89 #ifdef _MSC_VER
90 // 4786: Disable warnings about long (> 255 chars) identifiers.
91 // 4512: Disable warnings about assignment operators.
92 #pragma warning( push )
93 #pragma warning( disable:4786 4512 )
94 #endif
95 
96 #include "utility/all.h"
97 #include "heaps/all.h"
98 #include "locks/all.h"
99 #include "threads/all.h"
100 #include "wrappers/all.h"
101 
102 #ifdef _MSC_VER
103 #pragma warning( pop )
104 #endif
105 
106 #endif // _HEAPLAYERS_H_
Definition: heaplayers.h:34