sammccall added inline comments.

================
Comment at: clang-tools-extra/pseudo/lib/GLR.cpp:78
+    // We need to copy the list: Roots is consumed by the GC.
+    Roots = NewHeads;
+    GSS.gc(std::move(Roots));
----------------
hokein wrote:
> nit: I'd rather pass the NewHeads as a vector parameter, and get rid of the 
> `Roots` variable in the lambda, but up to you.
That would result in reallocating the array every time: we would allocate a new 
vector to copy  NewHeads into, copy it, gc() would own it and destroy 
(deallocate) it at the end.

As the code is now, Roots stays alive. Each time we GC we fill it up with 
elements, and then gc() clears them out again, but we never actually deallocate 
the buffer.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126723

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to