wasphin opened a new pull request, #3663: URL: https://github.com/apache/brpc/pull/3663
### What problem does this PR solve? Problem Summary: The JSON memory pool dereferences a failed chunk allocation and assumes a successful allocation when growing a buffer. ### What is changed and the side effects? Changed: - Return nullptr from pool allocation and reallocation when the backing allocator fails. - Preserve existing chunks and contents after a failed allocation. - Add a failing backing-allocator regression to CMake and Bazel. Side effects: - Performance effects: Negligible checks after allocating a chunk. - Breaking backward compatibility: No public signature changes. This fixes the allocator contract; DOM consumers still need their own allocation-failure handling. --- ### Check List: - [x] Changes compile locally. - [x] Added focused test coverage. - Please follow [Contributor Covenant Code of Conduct](https://github.com/apache/brpc/blob/master/CODE_OF_CONDUCT.md). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
