facebook / facebook/rocksdb

fix compilation check for `malloc_usable_size()` presence

Open
#6,494 3 comments 0 reactions 0 assignees View on GitHub
bug up-for-grabs
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.