[PATCH] Add ForEachChunk() to sanitizer allocators.

Alexey Samsonov samsonov at google.com
Sun Mar 17 23:08:49 PDT 2013


On Fri, Mar 15, 2013 at 9:35 PM, David Blaikie <dblaikie at gmail.com> wrote:

>
>
> ================
> Comment at: lib/sanitizer_common/tests/sanitizer_allocator_test.cc:571
> @@ +570,3 @@
> + public:
> +  explicit IterationTestCallback(std::set<void *> *chunks)
> +    : chunks_(chunks) {}
> ----------------
> (not important, but just a thought)
>
> The LLVM project codebase doesn't really have the convention to pass
> mutable data by pointer (we're usually more than happy to pass by non-const
> ref). Not sure if the sanitizer code has adopted this convention
> consistently/separately from the rest of LLVM.
>
> ================
> Comment at: lib/sanitizer_common/tests/sanitizer_allocator_test.cc:610
> @@ +609,3 @@
> +  a->ForceLock();
> +  a->template ForEachChunk<IterationTestCallback>(callback);
> +  a->ForceUnlock();
> ----------------
> Any reason you can't just call this with "a->ForEachChunk(callback)",
> relying on template argument deduction?
>

Fixed in r177245


>
> ================
> Comment at: lib/sanitizer_common/tests/sanitizer_allocator_test.cc:650
> @@ +649,3 @@
> +  a.ForceLock();
> +  a.ForEachChunk<IterationTestCallback>(callback);
> +  a.ForceUnlock();
> ----------------
> Also here you can probably drop the explicit template argument.
>
>
> http://llvm-reviews.chandlerc.com/D539
>



-- 
Alexey Samsonov, MSK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130318/383e717f/attachment.html>


More information about the llvm-commits mailing list