| 171 | __declspec(dllexport) |
| 172 | #endif |
| 173 | void* StompAlloc(intptr size) |
| 174 | { |
| 175 | AutoCrit autoCrit(gSA_CritSect); |
| 176 | |
| 177 | while (true) |
| 178 | { |
| 179 | for (auto itr = gAllocRanges.rbegin(); itr != gAllocRanges.rend(); itr++) |
| 180 | { |
| 181 | auto& alloc = *itr; |
| 182 | void* result = alloc.Alloc((int)size); |
| 183 | if (result != NULL) |
| 184 | return result; |
| 185 | } |
| 186 | |
| 187 | gAllocRanges.resize(gAllocRanges.size() + 1); |
| 188 | } |
| 189 | } |
| 190 | |
| 191 | extern "C" |
| 192 | #ifdef BF_STOMP_EXPORT |
no test coverage detected