]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commit
Introduce CacheAllocator, a custom allocator for cache blocks (#4437)
authorIgor Canadi <igor@rockset.com>
Wed, 3 Oct 2018 00:21:54 +0000 (17:21 -0700)
committerFosco Marotto <fjm@fb.com>
Wed, 31 Oct 2018 20:02:53 +0000 (13:02 -0700)
commitbb3b2eb960a162e10d7730f4e0a08fd8801d6184
tree6aeead457d42a53794e37eec5af418ec0b180bdd
parentae5305ee701f2b7e2d25b02d6c4c7432a0291d87
Introduce CacheAllocator, a custom allocator for cache blocks (#4437)

Summary:
This is a conceptually simple change, but it touches many files to
pass the allocator through function calls.

We introduce CacheAllocator, which can be used by clients to configure
custom allocator for cache blocks. Our motivation is to hook this up
with folly's `JemallocNodumpAllocator`
(https://github.com/facebook/folly/blob/f43ce6d6866b7b994b3019df561109afae050ebc/folly/experimental/JemallocNodumpAllocator.h),
but there are many other possible use cases.

Additionally, this commit cleans up memory allocation in
`util/compression.h`, making sure that all allocations are wrapped in a
unique_ptr as soon as possible.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/4437

Differential Revision: D10132814

Pulled By: yiwu-arbug

fbshipit-source-id: be1343a4b69f6048df127939fea9bbc96969f564
19 files changed:
HISTORY.md
cache/lru_cache.cc
cache/lru_cache.h
cache/sharded_cache.cc
cache/sharded_cache.h
include/rocksdb/cache.h
include/rocksdb/cache_allocator.h [new file with mode: 0644]
table/block_based_table_builder.cc
table/block_based_table_reader.cc
table/block_based_table_reader.h
table/block_fetcher.cc
table/block_fetcher.h
table/format.cc
table/format.h
table/plain_table_reader.h
table/table_test.cc
tools/db_bench_tool.cc
util/cache_allocator.h [new file with mode: 0644]
util/compression.h