Skip to content

Commit cf5c3fb

Browse files
committed
Add NDEBUGs
1 parent a6dd0bc commit cf5c3fb

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lld/MachO/Driver.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,10 @@ void multiThreadedPageInBackground(DeferredFiles &deferred) {
348348
using namespace std::chrono;
349349
static const size_t pageSize = Process::getPageSizeEstimate();
350350
static const size_t largeArchive = 10 * 1024 * 1024;
351-
static std::atomic_uint64_t totalBytes = 0;
352-
std::atomic_int index = 0, included = 0;
351+
std::atomic_int index = 0;
353352
#ifndef NDEBUG
353+
std::atomic_int numDeferedFilesTouched = 0;
354+
static std::atomic_uint64_t totalBytes = 0;
354355
auto t0 = high_resolution_clock::now();
355356
#endif
356357

@@ -364,7 +365,7 @@ void multiThreadedPageInBackground(DeferredFiles &deferred) {
364365
continue;
365366
#ifndef NDEBUG
366367
totalBytes += buff.size();
367-
included += 1;
368+
numDeferedFilesTouched += 1;
368369
#endif
369370

370371
// Reference all file's mmap'd pages to load them into memory.
@@ -377,8 +378,9 @@ void multiThreadedPageInBackground(DeferredFiles &deferred) {
377378
#ifndef NDEBUG
378379
auto dt = high_resolution_clock::now() - t0;
379380
if (Process::GetEnv("LLD_MULTI_THREAD_PAGE"))
380-
std::cerr << "multiThreadedPageIn " << totalBytes << "/" << included << "/"
381-
<< deferred.size() << "/" << std::setprecision(4)
381+
std::cerr << "multiThreadedPageIn " << totalBytes << "/"
382+
<< numDeferedFilesTouched << "/" << deferred.size() << "/"
383+
<< std::setprecision(4)
382384
<< duration_cast<milliseconds>(dt).count() / 1000. << "\n";
383385
#endif
384386
}

0 commit comments

Comments
 (0)