[PATCH] D155761: [lld-macho] Use fixed chunk size for UUID

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 19 17:24:11 PDT 2023


MaskRay updated this revision to Diff 542255.
MaskRay edited the summary of this revision.
MaskRay added a comment.

update description


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155761/new/

https://reviews.llvm.org/D155761

Files:
  lld/MachO/Writer.cpp


Index: lld/MachO/Writer.cpp
===================================================================
--- lld/MachO/Writer.cpp
+++ lld/MachO/Writer.cpp
@@ -1182,10 +1182,7 @@
   TimeTraceScope timeScope("Computing UUID");
 
   ArrayRef<uint8_t> data{buffer->getBufferStart(), buffer->getBufferEnd()};
-  unsigned chunkCount = parallel::strategy.compute_thread_count() * 10;
-  // Round-up integer division
-  size_t chunkSize = (data.size() + chunkCount - 1) / chunkCount;
-  std::vector<ArrayRef<uint8_t>> chunks = split(data, chunkSize);
+  std::vector<ArrayRef<uint8_t>> chunks = split(data, 1024 * 1024);
   // Leave one slot for filename
   std::vector<uint64_t> hashes(chunks.size() + 1);
   SmallVector<std::shared_future<void>> threadFutures;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D155761.542255.patch
Type: text/x-patch
Size: 745 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230720/27ff0137/attachment.bin>


More information about the llvm-commits mailing list