Support pw::Allocator in RefBase and sp
This will allow for custom allocators to be used by types implementing RefBase and using sp when the ANDROID_UTILS_USE_PW_ALLOCATOR flag is specified. If the allocator is not set, we will use standard new/delete as we do not control where the memory is allocated. A user may not use sp to allocate the memory, so we must use default new/delete. If the user sets the global allocator, they are expected to use it to allocate all objects if not using sp. We explicitly disallow allocating arrays of types using these constructs. Instead, we provide a simple buffer allocation macro. This reduces the number of combinations we need to support. Bug: 416545855 Flag: EXEMPT bugfix Test: atest libutils_binder_test Change-Id: I1d1a81dc345d88c94b2ca70c0b04fc32d9f04647
Loading
Please register or sign in to comment