• Benoit Lize's avatar
    base/allocator: Avoid (D)CHECK() in PartitionAllocator. · e90cf11a
    Benoit Lize authored
    PartitionAllocator can be used as the malloc() implementation. In this
    context, a (D)CHECK() which fires causes allocations, which creates
    reentrency issues when used inside PartitionAlloc.
    
    To avoid that, use PA_(D)CHECK() in base/allocator/partition_allocator/,
    which is identical to the unprefixed version if PartitionAlloc is not
    the malloc() implementation. Otherwise it uses simplified versions.
    
    This doesn't necessarily cover all the code reached from
    PartitionAlloc. This is not a correctness issue, as Chrome would still
    crash when a (D)CHECK() fires, but a debugability one. As a consequence,
    limiting the changes to the directory (rather than all code called from
    it) is sufficient.
    
    Bug: 998048
    Change-Id: I171be3e6bac35cf09a29400c4254adc6f995739b
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2249739
    Commit-Queue: Benoit L <lizeb@chromium.org>
    Reviewed-by: default avatarBartek Nowierski <bartekn@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#779762}
    e90cf11a
oom_callback.cc 702 Bytes