rocksdb/db
Tamir Duberstein 0dc3040d54 db: avoid #includeing malloc and jemalloc simultaneously
Summary:
This fixes a compilation failure on Linux when the system libc is not
glibc. jemalloc's configure script incorrectly assumes that glibc is
always used on Linux systems, producing glibc-style signatures; when
the system libc is e.g. musl, the following error is observed:

```
  [  0%] Building CXX object CMakeFiles/rocksdb.dir/db/db_impl.cc.o
  In file included from /go/src/github.com/cockroachdb/cockroach/c-deps/rocksdb.src/table/block.h:19:0,
                   from /go/src/github.com/cockroachdb/cockroach/c-deps/rocksdb.src/db/db_impl.cc:77:
  /x-tools/x86_64-unknown-linux-musl/x86_64-unknown-linux-musl/sysroot/usr/include/malloc.h:19:8: error: declaration of 'size_t malloc_usable_size(void*)' has a different exception specifier
   size_t malloc_usable_size(void *);
          ^~~~~~~~~~~~~~~~~~
  In file included from /go/src/github.com/cockroachdb/cockroach/c-deps/rocksdb.src/db/db_impl.cc:20:0:
  /go/native/x86_64-unknown-linux-musl/jemalloc/include/jemalloc/jemalloc.h:78:33: note: from previous declaration 'size_t malloc_usable_size(void*) throw ()'
   #  define je_malloc_usable_size malloc_usable_size
                                   ^
  /go/native/x86_64-unknown-linux-musl/jemalloc/include/jemalloc/jemalloc.h:239:41: note: in expansion of macro 'je_malloc_usable_size'
   JEMALLOC_EXPORT size_t JEMALLOC_NOTHROW je_malloc_usable_size(
                                           ^~~~~~~~~~~~~~~~~~~~~
  CMakeFiles/rocksdb.dir/build.make:350: recipe for target 'CMakeFiles/rocksdb.dir/db/db_impl.cc.o' failed
```

This works around the issue by rearranging the sources such that
jemalloc's headers are never in the same scope as the system's malloc
header. The jemalloc issue has been reported as well, see:
https://github.com/jemalloc/jemalloc/issues/778.

cc tschottdorf
Closes https://github.com/facebook/rocksdb/pull/2188

Differential Revision: D5163048

Pulled By: siying

fbshipit-source-id: c553125458892def175c1be5682b0330d80b2a0d
2017-05-31 22:43:02 -07:00
..
builder.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
builder.h Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
c_test.c support merge and delete in file ingestion 2017-05-26 12:11:21 -07:00
c.cc support merge and delete in file ingestion 2017-05-26 12:11:21 -07:00
column_family_test.cc fix column_family_test asan 2017-05-24 16:41:51 -07:00
column_family.cc Increase of compaction threads should be logged at info level instead of a warning 2017-05-26 09:56:13 -07:00
column_family.h Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
compact_files_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
compacted_db_impl.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
compacted_db_impl.h Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
compaction_iteration_stats.h Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
compaction_iterator_test.cc Support ingest_behind for IngestExternalFile 2017-05-17 11:42:42 -07:00
compaction_iterator.cc Support ingest_behind for IngestExternalFile 2017-05-17 11:42:42 -07:00
compaction_iterator.h Support ingest_behind for IngestExternalFile 2017-05-17 11:42:42 -07:00
compaction_job_stats_test.cc New API for background work in single thread pool 2017-05-23 11:12:27 -07:00
compaction_job_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
compaction_job.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
compaction_job.h Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
compaction_picker_test.cc Support ingest_behind for IngestExternalFile 2017-05-17 11:42:42 -07:00
compaction_picker_universal.cc Support ingest_behind for IngestExternalFile 2017-05-17 11:42:42 -07:00
compaction_picker_universal.h Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
compaction_picker.cc Support ingest_behind for IngestExternalFile 2017-05-17 11:42:42 -07:00
compaction_picker.h Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
compaction.cc Avoid calling fallocate with UINT64_MAX 2017-05-04 17:43:22 -07:00
compaction.h Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
comparator_db_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
convenience.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
corruption_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
cuckoo_table_db_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
db_basic_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
db_block_cache_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
db_bloom_filter_test.cc dont skip IO for filter blocks 2017-05-09 09:52:02 -07:00
db_compaction_filter_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
db_compaction_test.cc Introduce max_background_jobs mutable option 2017-05-24 11:29:08 -07:00
db_dynamic_level_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
db_filesnapshot.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
db_flush_test.cc New API for background work in single thread pool 2017-05-23 11:12:27 -07:00
db_impl_compaction_flush.cc Introduce max_background_jobs mutable option 2017-05-24 11:29:08 -07:00
db_impl_debug.cc Introduce max_background_jobs mutable option 2017-05-24 11:29:08 -07:00
db_impl_experimental.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
db_impl_files.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
db_impl_open.cc Introduce max_background_jobs mutable option 2017-05-24 11:29:08 -07:00
db_impl_readonly.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
db_impl_readonly.h Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
db_impl_write.cc Fixing blob db sequence number handling 2017-05-31 10:56:45 -07:00
db_impl.cc db: avoid #includeing malloc and jemalloc simultaneously 2017-05-31 22:43:02 -07:00
db_impl.h Introduce max_background_jobs mutable option 2017-05-24 11:29:08 -07:00
db_info_dumper.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
db_info_dumper.h Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
db_inplace_update_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
db_io_failure_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
db_iter_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
db_iter.cc Histogram of number of merge operands 2017-05-31 07:41:44 -07:00
db_iter.h Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
db_iterator_test.cc disable direct reads for log and manifest and add direct io to tests 2017-05-22 18:41:28 -07:00
db_log_iter_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
db_memtable_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
db_merge_operator_test.cc support merge and delete in file ingestion 2017-05-26 12:11:21 -07:00
db_options_test.cc Introduce max_background_jobs mutable option 2017-05-24 11:29:08 -07:00
db_properties_test.cc New API for background work in single thread pool 2017-05-23 11:12:27 -07:00
db_range_del_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
db_sst_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
db_statistics_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
db_table_properties_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
db_tailing_iter_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
db_test2.cc Introduce max_background_jobs mutable option 2017-05-24 11:29:08 -07:00
db_test_util.cc Fixing blob db sequence number handling 2017-05-31 10:56:45 -07:00
db_test_util.h Fixing blob db sequence number handling 2017-05-31 10:56:45 -07:00
db_test.cc New API for background work in single thread pool 2017-05-23 11:12:27 -07:00
db_universal_compaction_test.cc Fixed some spelling mistakes 2017-05-17 23:12:36 -07:00
db_wal_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
db_write_test.cc Fixing blob db sequence number handling 2017-05-31 10:56:45 -07:00
dbformat_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
dbformat.cc do not read next datablock if upperbound is reached 2017-05-05 23:20:01 -07:00
dbformat.h Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
deletefile_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
event_helpers.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
event_helpers.h Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
experimental.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
external_sst_file_basic_test.cc Support ingest file when range deletions exist 2017-05-31 13:57:19 -07:00
external_sst_file_ingestion_job.cc Support ingest file when range deletions exist 2017-05-31 13:57:19 -07:00
external_sst_file_ingestion_job.h Support ingest file when range deletions exist 2017-05-31 13:57:19 -07:00
external_sst_file_test.cc support merge and delete in file ingestion 2017-05-26 12:11:21 -07:00
fault_injection_test.cc Avoid unsupported attributes when not building with UBSAN 2017-05-30 11:13:01 -07:00
file_indexer_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
file_indexer.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
file_indexer.h Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
filename_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
flush_job_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
flush_job.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
flush_job.h Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
flush_scheduler.cc New WriteImpl to pipeline WAL/memtable write 2017-05-19 14:26:42 -07:00
flush_scheduler.h Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
forward_iterator_bench.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
forward_iterator.cc do not read next datablock if upperbound is reached 2017-05-05 23:20:01 -07:00
forward_iterator.h Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
internal_stats.cc Fix column family seconds_up accounting 2017-05-23 17:14:04 -07:00
internal_stats.h Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
job_context.h Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
listener_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
log_format.h Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
log_reader.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
log_reader.h Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
log_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
log_writer.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
log_writer.h Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
malloc_stats.cc db: avoid #includeing malloc and jemalloc simultaneously 2017-05-31 22:43:02 -07:00
malloc_stats.h db: avoid #includeing malloc and jemalloc simultaneously 2017-05-31 22:43:02 -07:00
managed_iterator.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
managed_iterator.h Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
manual_compaction_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
memtable_list_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
memtable_list.cc Support ingest file when range deletions exist 2017-05-31 13:57:19 -07:00
memtable_list.h Support ingest file when range deletions exist 2017-05-31 13:57:19 -07:00
memtable.cc Histogram of number of merge operands 2017-05-31 07:41:44 -07:00
memtable.h Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
merge_context.h Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
merge_helper_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
merge_helper.cc Histogram of number of merge operands 2017-05-31 07:41:44 -07:00
merge_helper.h Histogram of number of merge operands 2017-05-31 07:41:44 -07:00
merge_operator.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
merge_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
options_file_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
perf_context_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
pinned_iterators_manager.h Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
plain_table_db_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
prefix_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
range_del_aggregator_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
range_del_aggregator.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
range_del_aggregator.h Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
repair_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
repair.cc disable direct reads for log and manifest and add direct io to tests 2017-05-22 18:41:28 -07:00
snapshot_impl.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
snapshot_impl.h Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
table_cache.cc Support ingest file when range deletions exist 2017-05-31 13:57:19 -07:00
table_cache.h Support ingest file when range deletions exist 2017-05-31 13:57:19 -07:00
table_properties_collector_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
table_properties_collector.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
table_properties_collector.h Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
transaction_log_impl.cc disable direct reads for log and manifest and add direct io to tests 2017-05-22 18:41:28 -07:00
transaction_log_impl.h Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
version_builder_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
version_builder.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
version_builder.h Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
version_edit_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
version_edit.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
version_edit.h Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
version_set_test.cc Set lower-bound on dynamic level sizes 2017-05-04 18:16:12 -07:00
version_set.cc Support ingest file when range deletions exist 2017-05-31 13:57:19 -07:00
version_set.h Support ingest file when range deletions exist 2017-05-31 13:57:19 -07:00
wal_manager_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
wal_manager.cc disable direct reads for log and manifest and add direct io to tests 2017-05-22 18:41:28 -07:00
wal_manager.h Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
write_batch_base.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
write_batch_internal.h Fixing blob db sequence number handling 2017-05-31 10:56:45 -07:00
write_batch_test.cc support PopSavePoint for WriteBatch 2017-05-03 10:57:45 -07:00
write_batch.cc Fixing blob db sequence number handling 2017-05-31 10:56:45 -07:00
write_callback_test.cc Fix data races caught by tsan 2017-05-22 10:27:23 -07:00
write_callback.h Updated all copyright headers to the new format. 2016-02-09 15:12:00 -08:00
write_controller_test.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
write_controller.cc Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
write_controller.h Add GPLv2 as an alternative license. 2017-04-27 18:06:12 -07:00
write_thread.cc New WriteImpl to pipeline WAL/memtable write 2017-05-19 14:26:42 -07:00
write_thread.h New WriteImpl to pipeline WAL/memtable write 2017-05-19 14:26:42 -07:00