* * First level _omDebug alloc/free routines: call respective checks and dispatch * to routines which do the actual work * *******************************************************************/
| 108 | * |
| 109 | *******************************************************************/ |
| 110 | void* _omDebugAlloc(void* size_bin, omTrackFlags_t flags, OM_CTFL_DECL) |
| 111 | { |
| 112 | void* addr; |
| 113 | OM_R_DEF; |
| 114 | check = MAX(check, om_Opts.MinCheck); |
| 115 | track = MAX(track, om_Opts.MinTrack); |
| 116 | check = MIN(check, om_Opts.MaxCheck); |
| 117 | track = MIN(track, om_Opts.MaxTrack); |
| 118 | |
| 119 | if (check) |
| 120 | { |
| 121 | if (check > 1) |
| 122 | { |
| 123 | if (flags & OM_FBIN) |
| 124 | (void) _omCheckBin((omBin)size_bin, 1, check-1, omError_MemoryCorrupted, OM_FLR_VAL); |
| 125 | else if (check > 2) |
| 126 | { |
| 127 | omAssume(flags & OM_FSIZE); |
| 128 | (void) _omCheckMemory(check-2, omError_MemoryCorrupted, OM_FLR_VAL); |
| 129 | } |
| 130 | } |
| 131 | if (size_bin == NULL && ! (flags & OM_FSLOPPY)) |
| 132 | { |
| 133 | omReportError(omError_NullSizeAlloc, omError_NoError, OM_FLR_VAL, ""); |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | addr = __omDebugAlloc(size_bin, flags, track, OM_FLR_VAL); |
| 138 | |
| 139 | #ifdef OM_INTERNAL_DEBUG |
| 140 | (void) _omCheckAddr(addr, size_bin,flags|OM_FUSED,check, omError_InternalBug, OM_FLR); |
| 141 | #endif |
| 142 | |
| 143 | return addr; |
| 144 | } |
| 145 | |
| 146 | |
| 147 | void* _omDebugRealloc(void* old_addr, void* old_size_bin, void* new_size_bin, |
nothing calls this directly
no test coverage detected