[PATCH] D35358: [scudo] Do not grab a cache for secondary allocation & per related changes

Aleksey Shlyapnikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 13 13:08:27 PDT 2017


alekseyshl added inline comments.


================
Comment at: lib/scudo/scudo_allocator.cpp:390
+        SpinMutexLock l(&FallbackMutex);
+        Salt = FallbackPrng.getU8();
+        Ptr = BackendAllocator.Allocate(
----------------
cryptoad wrote:
> alekseyshl wrote:
> > I believe you want to {} two lines above too.
> I am not sure I understand what you mean here.
> The `FallbackMutex` encompasses both the Prng and the Cache, so I am using it for the whole else statement.
Ah, right, got carried away. Please ignore it.


================
Comment at: lib/scudo/scudo_allocator.cpp:421
+    CHECK_LE(UserBeg + Size,
+             AllocBeg + (FromPrimary ? AlignedSize : NeededSize));
     Header.State = ChunkAllocated;
----------------
cryptoad wrote:
> alekseyshl wrote:
> > Nit: I get why you did this, but now there's a logical disconnect between the size passed to the allocator and this statement.
> So bringing back `AllocationSize` here?
If it does not affect performance (why should it, though?), yes, please bring it back.


https://reviews.llvm.org/D35358





More information about the llvm-commits mailing list