Debian Codegraph @

vendor/Heap-Layers/utility/align.h

raw symbols SCIP
1 // -*- C++ -*-cxx . . $ `<file>/vendor/Heap-Layers/utility/align.h`/
2
3 #ifndef HL_ALIGN_H
4 #define HL_ALIGN_Hcxx . . $ `vendor/Heap-Layers/utility/align.h:4:9`!
5
6 #include <stdlib.h>
7
8 #if defined(__clang__cxx . . $ `<built-in>:3:9`!)
9 #pragma clang diagnostic push
10 #pragma clang diagnostic ignored "-Wunused-variable"
11 #endif
12
13 namespace HLcxx . . $ HL/ {
14
15 /// @name align
16 /// @brief Rounds up a value to the next multiple of v.
17 /// @note Argument must be a power of two.
18 template <size_t Alignment>
19 inline size_t aligncxx . . $ HL/align(ecdaa1632f49f591). (size_t v) {
20 static_assert((Alignment & (Alignment-1)) == 0,
21 "Alignment must be a power of two.");
22 return ((v + (Alignment-1)) & ~(Alignment-1));
23 }
24
25 }
26
27 #if defined(__clang__cxx . . $ `<built-in>:3:9`!)
28 #pragma clang diagnostic pop
29 #endif
30
31 #endif