| 335 | #ifdef DEF_BF_ALLOCDEBUG |
| 336 | |
| 337 | void DbgHeapCheck() |
| 338 | { |
| 339 | for (int i = 0; i < (int) gDbgHeapRecords.size(); i++) |
| 340 | { |
| 341 | auto& allocRecord = gDbgHeapRecords[i]; |
| 342 | |
| 343 | for (int i = 0; i < ALLOC_PADDING; i++) |
| 344 | { |
| 345 | assert(allocRecord.mPtr[i] == ALLOC_MAGIC); |
| 346 | assert(allocRecord.mPtr[ALLOC_PADDING + allocRecord.mSize + ALLOC_PADDING - i - 1] == ALLOC_MAGIC); |
| 347 | } |
| 348 | |
| 349 | if (allocRecord.mFreeTransactionIdx != 0) |
| 350 | { |
| 351 | int curHash = DbgHeapHashMemory(allocRecord.mPtr + ALLOC_PADDING, allocRecord.mSize); |
| 352 | assert(allocRecord.mHashAtFree == curHash); |
| 353 | } |
| 354 | } |
| 355 | |
| 356 | #ifndef BF_MINGW |
| 357 | _CrtCheckMemory(); |
| 358 | #endif |
| 359 | } |
| 360 | |
| 361 | void DbgHeapCheckLeaks() |
| 362 | { |
nothing calls this directly
no test coverage detected