[PATCH] D34243: [Sanitizers] Secondary allocator respects allocator_may_return_null=1.

Aleksey Shlyapnikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 15 16:16:32 PDT 2017


alekseyshl added inline comments.


================
Comment at: test/asan/TestCases/Linux/allocator_oom_test.cc:45
+#if __LP64__
+      (1ULL << 40) - (1ULL << 30);
+#else
----------------
eugenis wrote:
> This is fragile, but I don't really see a better way. Maybe add a while (x) loop around the allocation in case one is not enough?
> 
> Btw, why does allocating (1<<40) - (1ULL << 30) fail?
Because of "ulimit -v 22024290304" (there's quite a lot less than 1T memory left after all internal ASan allocations).


https://reviews.llvm.org/D34243





More information about the llvm-commits mailing list