• Chris Palmer's avatar
    Add simple correctness checks to PartitionAlloc. · 96a9ec31
    Chris Palmer authored
    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/+/1607149Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
    Reviewed-by: default avatarAlbert J. Wong <ajwong@chromium.org>
    Commit-Queue: Chris Palmer <palmer@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#659314}
    96a9ec31
partition_alloc.h 21.8 KB