Add simple correctness checks to PartitionAlloc.

ajwong pointed out that `PartitionRootBase::max_allocation` was used only in
tests. This CL additionally `DCHECK`s that it is not being mis-used in the most
simple ways. In the future, we might be able to change the API such that
`SizeSpecificPartitionAllocator` 'knows' its allocation size and just allocates
it, without needing a `size` parameter.

This CL also does some code cleanup. This involved making sure we always observe
`PartitionAllocReturnNull` in every case where `MEMORY_TOOL_REPLACES_ALLOCATOR`
is defined; previously we did not.

Bug: None
Change-Id: I04aa797176851e15ef3a0b803b85ddd038e0f772
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1607149
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Reviewed-by: Albert J. Wong <ajwong@chromium.org>
Commit-Queue: Chris Palmer <palmer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#659314}
2 files changed