• Benoit Lize's avatar
    android: Support PartitionAlloc as the malloc() implementation. · a27feee1
    Benoit Lize authored
    This CL adds support for the 'use_allocator = "partition"' GN argument
    on Android and Linux. This is not meant to ship, but to ease
    experimentation. Without this flag, there is no behavior change. With
    it, malloc() and new calls are redirected to PartitionAlloc.
    
    For DCHECK_IS_ON() builds, PartitionAlloc doesn't support the right
    alignment guarantees to suppose posix_memalign(), which is required at
    least on Linux. This is due to the addition of a "cookie" on both sides
    of the allocation, meant to detect improper memory writes. With this CL,
    the cookies are temporarily disabled with PartitionAlloc when it is used
    as the malloc() implementation.
    
    Change-Id: I1b1b6fc855fb48bbad04a82a2b60e320194943fd
    Bug: 998048
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2167281
    Commit-Queue: Benoit L <lizeb@chromium.org>
    Reviewed-by: default avatarWill Harris <wfh@chromium.org>
    Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#776916}
    a27feee1
BUILD.gn 142 KB