[PATCH] D69265: [scudo][standalone] Consolidate lists

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 28 07:37:11 PDT 2019


cryptoad marked 4 inline comments as done and an inline comment as not done.
cryptoad added inline comments.


================
Comment at: lib/scudo/standalone/list.h:101
     if (empty()) {
       X->Next = nullptr;
+      Last = X;
----------------
hctim wrote:
> if `empty()`, then `First == nullptr` as invariant,  can hoist  `X->Next = First` and this line out as well, right?
You are right, I missed those, thank you.
I changed that and also extracted the `Size` increment since it will be 0 when empty.


================
Comment at: lib/scudo/standalone/list.h:168
+    T *Prev = Y->Prev;
+    CHECK_EQ(Prev->Next, Y);
+    Prev->Next = X;
----------------
hctim wrote:
> DCHECK?
On this one, same as with the doubly linked lists, since we are writing `Prev->Next` I want to make sure that the list is consistent in the event of an intentional corruption of `Y->Prev`.
I added a comment.


Repository:
  rCRT Compiler Runtime

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

https://reviews.llvm.org/D69265





More information about the llvm-commits mailing list