[66502b8] | 1 | /******************************************************************* |
---|
| 2 | * File: omAlloc.h |
---|
| 3 | * Purpose: declaration of public routines for omalloc |
---|
| 4 | * Author: obachman@mathematik.uni-kl.de (Olaf Bachmann) |
---|
| 5 | * Created: 11/99 |
---|
| 6 | * Version: $Id: omAlloc.h,v 1.1.1.1 1999-11-18 17:45:52 obachman Exp $ |
---|
| 7 | *******************************************************************/ |
---|
| 8 | #ifndef OM_ALLOC_H |
---|
| 9 | #define OM_ALLOC_H |
---|
| 10 | |
---|
| 11 | /******************************************************************* |
---|
| 12 | * |
---|
| 13 | * Alloc/Free |
---|
| 14 | * |
---|
| 15 | *******************************************************************/ |
---|
| 16 | |
---|
| 17 | void* omFuncAlloc(size_t size); |
---|
| 18 | void* omFuncAlloc0(size_t size); |
---|
| 19 | void* omFuncAlloc(size_t size); |
---|
| 20 | void* omFuncAlloc0(size_t size); |
---|
| 21 | void omFuncFree(void* addr); |
---|
| 22 | |
---|
| 23 | void* omFuncAllocBlock(size_t size); |
---|
| 24 | void* omFuncAlloc0Block(size_t size); |
---|
| 25 | void omFuncFreeBlock(void* addr, size_t size); |
---|
| 26 | |
---|
| 27 | void* omFuncAllocHeap(omHeap heap); |
---|
| 28 | void* omFuncAlloc0Heap(omHeap heap); |
---|
| 29 | void omFuncFreeHeap(void* addr); |
---|
| 30 | |
---|
| 31 | |
---|
| 32 | #ifndef OM_DEBUG |
---|
| 33 | |
---|
| 34 | #define omAlloc(size) _omAlloc(size) |
---|
| 35 | #define omAlloc0(size) _omAlloc0(size) |
---|
| 36 | #define omAllocAligned(size) _omAllocAligned(size) |
---|
| 37 | #define omTypeAlloc(size) _omTypeAlloc(addr, type, size) |
---|
| 38 | #define omTypeAlloc0(size) _omTypeAlloc0(addr, type, size) |
---|
| 39 | #define omTypeAllocAligned(size) _omTypeAllocAligned(addr, type, size) |
---|
| 40 | #define omFree(addr) _omFree(addr) |
---|
| 41 | |
---|
| 42 | #define omAllocBlock(size) _omAllocBlock(size) |
---|
| 43 | #define omAlloc0Block(size) _omAlloc0Block(size) |
---|
| 44 | #define omAllocAlignedBlock(size) _omAllocAlignedBlock(size) |
---|
| 45 | #define omTypeAllocBlock(size) _omTypeAllocBlock(addr, type, size) |
---|
| 46 | #define omTypeAlloc0Block(size) _omTypeAlloc0Block(addr, type, size) |
---|
| 47 | #define omTypeAllocAlignedBlock(size) _omTypeAllocAlignedBlock(addr, type, size) |
---|
| 48 | #define omFreeBlock(addr, size) _omFreeBlock(addr, size) |
---|
| 49 | |
---|
| 50 | #define omAllocHeap(heap) _omAllocHeap(heap) |
---|
| 51 | #define omAlloc0Heap(heap) _omAlloc0Heap(heap) |
---|
| 52 | #define omAllocAlignedHeap(heap) _omAllocAligned(heap) |
---|
| 53 | #define omTypeAllocHeap(size) _omTypeAllocHeap(addr, type, size) |
---|
| 54 | #define omTypeAlloc0Heap(size) _omTypeAlloc0Heap(addr, type, size) |
---|
| 55 | #define omTypeAllocAlignedHeap(size) _omTypeAllocAlignedHeap(addr, type, size) |
---|
| 56 | #define omFreeHeap(addr) _omFreeHeap(addr) |
---|
| 57 | |
---|
| 58 | #define omDebugAlloc(size, fn, l) _omAlloc(size) |
---|
| 59 | #define omDebugAlloc0(size, fn, l) _omAlloc0(size) |
---|
| 60 | #define omDebugAllocAligned(size, fn, l) _omAllocAligned(size) |
---|
| 61 | #define omDebugTypeAlloc(size, fn, l) _omTypeAlloc(addr, type, size) |
---|
| 62 | #define omDebugTypeAlloc0(size, fn, l) _omTypeAlloc0(addr, type, size) |
---|
| 63 | #define omDebugTypeAllocAligned(size, fn, l) _omTypeAllocAligned(addr, type, size) |
---|
| 64 | #define omDebugFree(addr, fn, l) _omFree(addr) |
---|
| 65 | |
---|
| 66 | #define omDebugAllocBlock(size, fn, l) _omAllocBlock(size) |
---|
| 67 | #define omDebugAlloc0Block(size, fn, l) _omAlloc0Block(size) |
---|
| 68 | #define omDebugAllocAlignedBlock(size, fn, l) _omAllocAlignedBlock(size) |
---|
| 69 | #define omDebugTypeAllocBlock(size, fn, l) _omTypeAllocBlock(addr, type, size) |
---|
| 70 | #define omDebugTypeAlloc0Block(size, fn, l) _omTypeAlloc0Block(addr, type, size) |
---|
| 71 | #define omDebugTypeAllocAlignedBlock(size, fn, l) _omTypeAllocAlignedBlock(addr, type, size) |
---|
| 72 | #define omDebugFreeBlock(addr, size, fn, l) _omFreeBlock(addr, size) |
---|
| 73 | |
---|
| 74 | #define omDebugAllocHeap(heap, fn, l) _omAllocHeap(heap) |
---|
| 75 | #define omDebugAlloc0Heap(heap, fn, l) _omAlloc0Heap(heap) |
---|
| 76 | #define omDebugAllocAlignedHeap(heap, fn, l) _omAllocAligned(heap) |
---|
| 77 | #define omDebugTypeAllocHeap(size, fn, l) _omTypeAllocHeap(addr, type, size) |
---|
| 78 | #define omDebugTypeAlloc0Heap(size, fn, l) _omTypeAlloc0Heap(addr, type, size) |
---|
| 79 | #define omDebugTypeAllocAlignedHeap(size, fn, l) _omTypeAllocAlignedHeap(addr, type, size) |
---|
| 80 | #define omDebugFreeHeap(addr, fn, l) _omFreeHeap(addr) |
---|
| 81 | |
---|
| 82 | |
---|
| 83 | #define omTrackAlloc(size) _omAlloc(size) |
---|
| 84 | #define omTrackAlloc0(size) _omAlloc0(size) |
---|
| 85 | #define omTrackAllocAligned(size) _omAllocAligned(size) |
---|
| 86 | #define omTypeTrackAlloc(size) _omTypeAlloc(addr, type, size) |
---|
| 87 | #define omTypeTrackAlloc0(size) _omTypeAlloc0(addr, type, size) |
---|
| 88 | #define omTypeTrackAllocAligned(size) _omTypeAllocAligned(addr, type, size) |
---|
| 89 | #define omTrackFree(addr) _omFree(addr) |
---|
| 90 | |
---|
| 91 | #define omTrackAllocBlock(size) _omAllocBlock(size) |
---|
| 92 | #define omTrackAlloc0Block(size) _omAlloc0Block(size) |
---|
| 93 | #define omTrackAllocAlignedBlock(size) _omAllocAlignedBlock(size) |
---|
| 94 | #define omTypeTrackAllocBlock(size) _omTypeAllocBlock(addr, type, size) |
---|
| 95 | #define omTypeTrackAlloc0Block(size) _omTypeAlloc0Block(addr, type, size) |
---|
| 96 | #define omTypeTrackAllocAlignedBlock(size) _omTypeAllocAlignedBlock(addr, type, size) |
---|
| 97 | #define omTrackFreeBlock(addr, size) _omFreeBlock(addr, size) |
---|
| 98 | |
---|
| 99 | #define omTrackAllocHeap(heap) _omAllocHeap(heap) |
---|
| 100 | #define omTrackAlloc0Heap(heap) _omAlloc0Heap(heap) |
---|
| 101 | #define omTrackAllocAlignedHeap(heap) _omAllocAligned(heap) |
---|
| 102 | #define omTypeTrackAllocHeap(size) _omTypeAllocHeap(addr, type, size) |
---|
| 103 | #define omTypeTrackAlloc0Heap(size) _omTypeAlloc0Heap(addr, type, size) |
---|
| 104 | #define omTypeTrackAllocAlignedHeap(size) _omTypeAllocAlignedHeap(addr, type, size) |
---|
| 105 | #define omTrackFreeHeap(addr) _omFreeHeap(addr) |
---|
| 106 | |
---|
| 107 | #define omDebugTrackAlloc(size, fn, l) _omAlloc(size) |
---|
| 108 | #define omDebugTrackAlloc0(size, fn, l) _omAlloc0(size) |
---|
| 109 | #define omDebugTrackAllocAligned(size, fn, l) _omAllocAligned(size) |
---|
| 110 | #define omDebugTypeTrackAlloc(size, fn, l) _omTypeAlloc(addr, type, size) |
---|
| 111 | #define omDebugTypeTrackAlloc0(size, fn, l) _omTypeAlloc0(addr, type, size) |
---|
| 112 | #define omDebugTypeTrackAllocAligned(size, fn, l) _omTypeAllocAligned(addr, type, size) |
---|
| 113 | #define omDebugTrackFree(addr, fn, l) _omFree(addr) |
---|
| 114 | |
---|
| 115 | #define omDebugTrackAllocBlock(size, fn, l) _omAllocBlock(size) |
---|
| 116 | #define omDebugTrackAlloc0Block(size, fn, l) _omAlloc0Block(size) |
---|
| 117 | #define omDebugTrackAllocAlignedBlock(size, fn, l) _omAllocAlignedBlock(size) |
---|
| 118 | #define omDebugTypeTrackAllocBlock(size, fn, l) _omTypeAllocBlock(addr, type, size) |
---|
| 119 | #define omDebugTypeTrackAlloc0Block(size, fn, l) _omTypeAlloc0Block(addr, type, size) |
---|
| 120 | #define omDebugTypeTrackAllocAlignedBlock(size, fn, l) _omTypeAllocAlignedBlock(addr, type, size) |
---|
| 121 | #define omDebugTrackFreeBlock(addr, size, fn, l) _omFreeBlock(addr, size) |
---|
| 122 | |
---|
| 123 | #define omDebugTrackAllocHeap(heap, fn, l) _omAllocHeap(heap) |
---|
| 124 | #define omDebugTrackAlloc0Heap(heap, fn, l) _omAlloc0Heap(heap) |
---|
| 125 | #define omDebugTrackAllocAlignedHeap(heap, fn, l) _omAllocAligned(heap) |
---|
| 126 | #define omDebugTypeTrackAllocHeap(size, fn, l) _omTypeAllocHeap(addr, type, size) |
---|
| 127 | #define omDebugTypeTrackAlloc0Heap(size, fn, l) _omTypeAlloc0Heap(addr, type, size) |
---|
| 128 | #define omDebugTypeTrackAllocAlignedHeap(size, fn, l) _omTypeAllocAlignedHeap(addr, type, size) |
---|
| 129 | #define omDebugTrackFreeHeap(addr, fn, l) _omFreeHeap(addr) |
---|
| 130 | |
---|
| 131 | #else |
---|
| 132 | |
---|
| 133 | #define omAlloc(size) omDebugAlloc(size, __FILE__, __LINE__) |
---|
| 134 | #define omAlloc0(size) omDebugAlloc0(size, __FILE__, __LINE__) |
---|
| 135 | #define omAllocAligned(size) omDebugAllocAligned(size, __FILE__, __LINE__) |
---|
| 136 | #define omTypeAlloc(size) omDebugTypeAlloc(addr, type, size, __FILE__, __LINE__) |
---|
| 137 | #define omTypeAlloc0(size) omDebugTypeAlloc0(addr, type, size, __FILE__, __LINE__) |
---|
| 138 | #define omTypeAllocAligned(size) omDebugTypeAllocAligned(addr, type, size, __FILE__, __LINE__) |
---|
| 139 | #define omFree(addr) omDebugFree(addr, __FILE__, __LINE__) |
---|
| 140 | |
---|
| 141 | #define omAllocBlock(size) omDebugAllocBlock(size, __FILE__, __LINE__) |
---|
| 142 | #define omAlloc0Block(size) omDebugAlloc0Block(size, __FILE__, __LINE__) |
---|
| 143 | #define omAllocAlignedBlock(size) omDebugAllocAlignedBlock(size, __FILE__, __LINE__) |
---|
| 144 | #define omTypeAllocBlock(size) omDebugTypeAllocBlock(addr, type, size, __FILE__, __LINE__) |
---|
| 145 | #define omTypeAlloc0Block(size) omDebugTypeAlloc0Block(addr, type, size, __FILE__, __LINE__) |
---|
| 146 | #define omTypeAllocAlignedBlock(size) omDebugTypeAllocAlignedBlock(addr, type, size, __FILE__, __LINE__) |
---|
| 147 | #define omFreeBlock(addr, size) omDebugFreeBlock(addr, size, __FILE__, __LINE__) |
---|
| 148 | |
---|
| 149 | #define omAllocHeap(heap) omDebugAllocHeap(heap, __FILE__, __LINE__) |
---|
| 150 | #define omAlloc0Heap(heap) omDebugAlloc0Heap(heap, __FILE__, __LINE__) |
---|
| 151 | #define omAllocAlignedHeap(heap) omDebugAllocAligned(heap, __FILE__, __LINE__) |
---|
| 152 | #define omTypeAllocHeap(size) omDebugTypeAllocHeap(addr, type, size, __FILE__, __LINE__) |
---|
| 153 | #define omTypeAlloc0Heap(size) omDebugTypeAlloc0Heap(addr, type, size, __FILE__, __LINE__) |
---|
| 154 | #define omTypeAllocAlignedHeap(size) omDebugTypeAllocAlignedHeap(addr, type, size, __FILE__, __LINE__) |
---|
| 155 | #define omFreeHeap(addr) omDebugFreeHeap(addr, __FILE__, __LINE__) |
---|
| 156 | |
---|
| 157 | #define omTrackAlloc(size) omDebugTrackAlloc(size, __FILE__, __LINE__) |
---|
| 158 | #define omTrackAlloc0(size) omDebugTrackAlloc0(size, __FILE__, __LINE__) |
---|
| 159 | #define omTrackAllocAligned(size) omDebugTrackAllocAligned(size, __FILE__, __LINE__) |
---|
| 160 | #define omTypeTrackAlloc(size) omDebugTypeTrackAlloc(addr, type, size, __FILE__, __LINE__) |
---|
| 161 | #define omTypeTrackAlloc0(size) omDebugTypeTrackAlloc0(addr, type, size, __FILE__, __LINE__) |
---|
| 162 | #define omTypeTrackAllocAligned(size) omDebugTypeTrackAllocAligned(addr, type, size, __FILE__, __LINE__) |
---|
| 163 | #define omTrackFree(addr) omDebugFree(addr, __FILE__, __LINE__) |
---|
| 164 | |
---|
| 165 | #define omTrackAllocBlock(size) omDebugTrackAllocBlock(size, __FILE__, __LINE__) |
---|
| 166 | #define omTrackAlloc0Block(size) omDebugTrackAlloc0Block(size, __FILE__, __LINE__) |
---|
| 167 | #define omTrackAllocAlignedBlock(size) omDebugTrackAllocAlignedBlock(size, __FILE__, __LINE__) |
---|
| 168 | #define omTypeTrackAllocBlock(size) omDebugTypeTrackAllocBlock(addr, type, size, __FILE__, __LINE__) |
---|
| 169 | #define omTypeTrackAlloc0Block(size) omDebugTypeTrackAlloc0Block(addr, type, size, __FILE__, __LINE__) |
---|
| 170 | #define omTypeTrackAllocAlignedBlock(size) omDebugTypeTrackAllocAlignedBlock(addr, type, size, __FILE__, __LINE__) |
---|
| 171 | #define omTrackFreeBlock(addr, size) omDebugFreeBlock(addr, size, __FILE__, __LINE__) |
---|
| 172 | |
---|
| 173 | #define omTrackAllocHeap(heap) omDebugTrackAllocHeap(heap, __FILE__, __LINE__) |
---|
| 174 | #define omTrackAlloc0Heap(heap) omDebugTrackAlloc0Heap(heap, __FILE__, __LINE__) |
---|
| 175 | #define omTrackAllocAlignedHeap(heap) omDebugTrackAllocAligned(heap, __FILE__, __LINE__) |
---|
| 176 | #define omTypeTrackAllocHeap(size) omDebugTypeTrackAllocHeap(addr, type, size, __FILE__, __LINE__) |
---|
| 177 | #define omTypeTrackAlloc0Heap(size) omDebugTypeTrackAlloc0Heap(addr, type, size, __FILE__, __LINE__) |
---|
| 178 | #define omTypeTrackAllocAlignedHeap(size) omDebugTypeTrackAllocAlignedHeap(addr, type, size, __FILE__, __LINE__) |
---|
| 179 | #define omTrackFreeHeap(addr) omDebugFreeHeap(addr, __FILE__, __LINE__) |
---|
| 180 | |
---|
| 181 | |
---|
| 182 | #endif /* OM_DEBUG */ |
---|
| 183 | |
---|
| 184 | #ifdef HAVE_CONFIG_H |
---|
| 185 | #include "omConfig.h" |
---|
| 186 | #endif |
---|
| 187 | |
---|
| 188 | #include "omPrivate.h" |
---|
| 189 | |
---|
| 190 | #endif /* OM_ALLOC_H */ |
---|