[PATCH] D61654: [scudo][standalone] Introduce the chunk header

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 7 15:46:51 PDT 2019


vitalybuka added inline comments.


================
Comment at: lib/scudo/standalone/chunk.h:69
+#else
+  if (atomic_load_relaxed(&HashAlgorithm) == HardwareCRC32) {
+    u32 Crc = computeHardwareCRC32(Seed, Value);
----------------
cryptoad wrote:
> vitalybuka wrote:
> > So you cant guaranty that it does not call computeChecksum before init() so you can avoid atomic operation?
> I am not sure I understand this, do you mean I should not use atomics?
> The function should never be called prior to initialization (malloc will call the allocator's init() before servicing an allocation).
If all threads will be blocked on init() and released after it's done, and global never changes after that then atomic is not needed


Repository:
  rCRT Compiler Runtime

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

https://reviews.llvm.org/D61654





More information about the llvm-commits mailing list