[PATCH] D35275: [Sanitizers] ASan/MSan/LSan allocators set errno on failure.
Vitaly Buka via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 12 16:29:23 PDT 2017
vitalybuka added inline comments.
================
Comment at: lib/asan/asan_allocator.cc:848
+ // pvalloc(0) should allocate one page.
+ size = size == 0 ? PageSize : RoundUpTo(size, PageSize);
+ return ptr_check(
----------------
easier to read: size = size ? RoundUpTo(size, PageSize) : PageSize;
================
Comment at: lib/scudo/scudo_allocator.cpp:662
+ // pvalloc(0) should allocate one page.
+ Size = Size == 0 ? PageSize : RoundUpTo(Size, PageSize);
+ return ptr_check(Instance.allocate(Size, PageSize, FromMemalign));
----------------
same
https://reviews.llvm.org/D35275
More information about the llvm-commits
mailing list