[PATCH] D91392: [hwasan] Fix Thread reuse (try 2).

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 12 16:10:49 PST 2020


eugenis added inline comments.


================
Comment at: compiler-rt/lib/hwasan/hwasan_thread_list.h:113
+  void RemoveThreadFromLiveList(Thread *t) {
+    for (Thread *&t2 : live_list_)
+      if (t2 == t) {
----------------
vitalybuka wrote:
> maybe you can just flip some the t->dead = true
> and do some garbage collection when e.g. live_list_ contains 50% of dead?
> 
this sounds like a premature optimization, and it would increase RAM by decreasing CPU use, which is not the direction we want to move on mobile


================
Comment at: compiler-rt/lib/hwasan/hwasan_thread_list.h:115
+      if (t2 == t) {
+        live_list_.erase(&t2);
+        return;
----------------
vitalybuka wrote:
> t2 = live_list_.back();
> live_list_.pop_back();
This would remove the last element, why?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91392



More information about the llvm-commits mailing list