ilya-biryukov added inline comments.
================ Comment at: clangd/TUScheduler.cpp:360 std::lock_guard<std::mutex> Lock(Mutex); + OldPreamble.reset(); if (NewPreamble) ---------------- ioeric wrote: > ilya-biryukov wrote: > > ioeric wrote: > > > Why reset? > > We don't need the old preamble at this point, so we give it a chance to die > > (if there are no more references). > > Note that there's an expensive operation that follows (building the AST), > > so removing the preamble before it seems like a win > sg. and do we guard this with mutex because the same old preamble data can be > accessed by other threads? might worth a comment. Guarding with mutex is not actually required. Moved it out of the locked section and added a comment, thanks! Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D49783 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits