Skip to content

Commit

Permalink
Changes cache functions to accept a cache by reference
Browse files Browse the repository at this point in the history
  • Loading branch information
Eduardo Barreto Alexandre committed Oct 11, 2020
1 parent 63f7a0f commit ae1eb65
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2219,7 +2219,7 @@ impl DBOptions {
/// Not supported in ROCKSDB_LITE mode!
///
/// Rust: will move in and use share_ptr
pub fn row_cache(self, val: Option<Cache>) -> Self {
pub fn row_cache(self, val: Option<&Cache>) -> Self {
unsafe {
if let Some(cache) = val {
ll::rocks_dboptions_set_row_cache(self.raw, cache.raw());
Expand Down
4 changes: 2 additions & 2 deletions src/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ impl BlockBasedTableOptions {
/// If non-NULL use the specified cache for blocks.
///
/// If NULL, rocksdb will automatically create and use an 8MB internal cache.
pub fn block_cache(self, val: Option<Cache>) -> Self {
pub fn block_cache(self, val: Option<&Cache>) -> Self {
unsafe {
let ptr = val.map(|c| c.raw()).unwrap_or_else(ptr::null_mut);
ll::rocks_block_based_table_options_set_block_cache(self.raw, ptr);
Expand All @@ -189,7 +189,7 @@ impl BlockBasedTableOptions {
/// If non-NULL use the specified cache for compressed blocks.
///
/// If NULL, rocksdb will not use a compressed block cache.
pub fn block_cache_compressed(self, val: Option<Cache>) -> Self {
pub fn block_cache_compressed(self, val: Option<&Cache>) -> Self {
unsafe {
let ptr = val.map(|c| c.raw()).unwrap_or_else(ptr::null_mut);
ll::rocks_block_based_table_options_set_block_cache_compressed(self.raw, ptr);
Expand Down

0 comments on commit ae1eb65

Please sign in to comment.