fix compilation check for `malloc_usable_size()` presence
- Dominant language
- C++
- Stars
- 32.1k
- Forks
- 6.9k
- Avg merge
- 32m
- Merged PRs (30d)
- 1
Description
> Note: Please use Issues only for bug reports. For questions, discussions, feature requests, etc. post to dev group: https://groups.google.com/forum/#!forum/rocksdb or https://www.facebook.com/groups/rocksdb.dev
### Expected behavior
When non-default allocator is chosen (jemalloc or tcmalloc), the presence of `malloc_usable_size()` in that particular allocator should be used to decide the value of `-DROCKSDB_MALLOC_USABLE_SIZE`.
### Actual behavior
Regardless of the configured allocator, the compilation checks for the presence of `malloc_usable_size()` in the default allocator: https://github.com/facebook/rocksdb/blob/0a0151fb99b306dc0b1f6b22df8073f8084da795/build_tools/build_detect_platform#L412-L425. This causes runtime crashes when the default allocator supports `malloc_usable_size()` but the runtime allocator does not (e.g., older versions of tcmalloc).
Contributor guide
Assessment
This issue has not been assessed yet.