Debian Codegraph @

vendor/Heap-Layers/heaps/objectrep/addheap.h

raw symbols SCIP
1 /* -*- C++ -*- */cxx . . $ `<file>/vendor/Heap-Layers/heaps/objectrep/addheap.h`/
2
3 #ifndef HL_ADDHEAP_H
4 #define HL_ADDHEAP_Hcxx . . $ `vendor/Heap-Layers/heaps/objectrep/addheap.h:4:9`!
5
6 /*
7
8 Heap Layers: An Extensible Memory Allocation Infrastructure
9
10 Copyright (C) 2000-2020 by Emery Berger
11 http://www.emeryberger.com
12 [email protected]
13
14 Heap Layers is distributed under the terms of the Apache 2.0 license.
15
16 You may obtain a copy of the License at
17 http://www.apache.org/licenses/LICENSE-2.0
18
19 */
20
21 // Reserve space for a class in the head of every allocated object.
22
23 #include <assert.h>
24 #include "utility/lcm.h"cxx . . $ `<file>/vendor/Heap-Layers/utility/lcm.h`/
25
26 namespace HLcxx . . $ HL/ {
27
28 template <class Add, class SuperHeap>
29 class AddHeapcxx . . $ HL/AddHeap# : public SuperHeap {
30 public:
31
32 inline void * malloccxx . . $ HL/AddHeap#malloc(bfcfa4d6b7f7ef64). (size_t sz) {
33 void * ptr = SuperHeap::malloc (sz +cxx . . $ std/operator+(933aeee3a62e2e30). HeaderSizecxx . . $ HL/AddHeap#HeaderSize.);
34 void * newPtr = (char *) ptr +cxx . . $ std/operator+(933aeee3a62e2e30). HeaderSizecxx . . $ HL/AddHeap#HeaderSize.;
35 return newPtr;
36 }
37
38 inline void freecxx . . $ HL/AddHeap#free(5d22bdacc48458e8). (void * ptr) {
39 SuperHeap::free (getOriginalcxx . . $ HL/AddHeap#getOriginal(9f162e79bfc6c74).(ptr));
40 }
41
42 inline size_t getSizecxx . . $ HL/AddHeap#getSize(751e5d26f8574c32). (void * ptr) {
43 return SuperHeap::getSize (getOriginalcxx . . $ HL/AddHeap#getOriginal(9f162e79bfc6c74).(ptr));
44 }
45
46 private:
47
48 inline void * getOriginalcxx . . $ HL/AddHeap#getOriginal(9f162e79bfc6c74). (void * ptr) {
49 void * origPtr = (void *) ((char *) ptr -cxx . . $ std/operator-(a6e85813984128c7). HeaderSizecxx . . $ HL/AddHeap#HeaderSize.);
50 return origPtr;
51 }
52
53 // A size that preserves existing alignment restrictions.
54 // Beware: can seriously increase size requirements.
55 enumcxx . . $ HL/AddHeap#$anonymous_type_0# { HeaderSizecxx . . $ HL/AddHeap#HeaderSize. = lcmcxx . . $ HL/lcm#<(int) SuperHeap::Alignment, sizeof(Add)>::value };
56
57 };
58
59 }
60 #endif