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

Aleksey Shlyapnikov via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 22 17:41:33 PST 2016


alekseyshl added a comment.

PTAL



================
Comment at: lib/sanitizer_common/sanitizer_allocator_primary64.h:488
+      return;  // No chance to release anything.
     if ((region->rtoi.n_freed_at_last_release - region->n_freed) * chunk_size <
+        kReleaseToOsGranularity) {
----------------
eugenis wrote:
> Wait, is this not always negative / underflown?
> region->n_freed grows monotonically.
> 
Good catch!


https://reviews.llvm.org/D27003





More information about the llvm-commits mailing list