[PATCH] D27003: Return memory to OS right after free (not in the async thread).

Evgeniy Stepanov via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 22 18:07:21 PST 2016


eugenis added inline comments.


================
Comment at: lib/asan/asan_activation.cc:116
   disabled.may_return_null = true;
+  disabled.release_to_os_interval_ms = kReleaseToOSIntervalNever;
   ReInitializeAllocator(disabled);
----------------
Deactivation is meant to reduce memory footprint. It should keep the current value of release_to_os.


================
Comment at: lib/sanitizer_common/sanitizer_allocator_primary64.h:498
+    u64 now_ns = NanoTime();
+    if (region->rtoi.last_release_at_ns + interval_ms * 1000000 > now_ns)
+      return;  // Memory was returned recently.
----------------
eugenis wrote:
> For general sanity, check that now_ns is larger than last_release_at_ns.
I meant a non-fatal check, in case the time wraps. After a closer look, perhaps it can not wrap, but it may jump around (and even back). Let's just remove the check.



https://reviews.llvm.org/D27003





More information about the llvm-commits mailing list