diff --git a/db/c.cc b/db/c.cc index ab5bfe057..d817f5b17 100644 --- a/db/c.cc +++ b/db/c.cc @@ -4679,7 +4679,7 @@ rocksdb_cache_t* rocksdb_cache_create_lru_with_strict_capacity_limit( } rocksdb_cache_t* rocksdb_cache_create_lru_opts( - rocksdb_lru_cache_options_t* opt) { + const rocksdb_lru_cache_options_t* opt) { rocksdb_cache_t* c = new rocksdb_cache_t; c->rep = NewLRUCache(opt->rep); return c; @@ -4726,7 +4726,7 @@ rocksdb_cache_t* rocksdb_cache_create_hyper_clock( } rocksdb_cache_t* rocksdb_cache_create_hyper_clock_opts( - rocksdb_hyper_clock_cache_options_t* opts) { + const rocksdb_hyper_clock_cache_options_t* opts) { rocksdb_cache_t* c = new rocksdb_cache_t; c->rep = opts->rep.MakeSharedCache(); return c; @@ -4742,15 +4742,15 @@ void rocksdb_cache_set_capacity(rocksdb_cache_t* cache, size_t capacity) { cache->rep->SetCapacity(capacity); } -size_t rocksdb_cache_get_capacity(rocksdb_cache_t* cache) { +size_t rocksdb_cache_get_capacity(const rocksdb_cache_t* cache) { return cache->rep->GetCapacity(); } -size_t rocksdb_cache_get_usage(rocksdb_cache_t* cache) { +size_t rocksdb_cache_get_usage(const rocksdb_cache_t* cache) { return cache->rep->GetUsage(); } -size_t rocksdb_cache_get_pinned_usage(rocksdb_cache_t* cache) { +size_t rocksdb_cache_get_pinned_usage(const rocksdb_cache_t* cache) { return cache->rep->GetPinnedUsage(); } diff --git a/include/rocksdb/c.h b/include/rocksdb/c.h index 809275891..aac55638a 100644 --- a/include/rocksdb/c.h +++ b/include/rocksdb/c.h @@ -2006,7 +2006,7 @@ extern ROCKSDB_LIBRARY_API rocksdb_cache_t* rocksdb_cache_create_lru( extern ROCKSDB_LIBRARY_API rocksdb_cache_t* rocksdb_cache_create_lru_with_strict_capacity_limit(size_t capacity); extern ROCKSDB_LIBRARY_API rocksdb_cache_t* rocksdb_cache_create_lru_opts( - rocksdb_lru_cache_options_t*); + const rocksdb_lru_cache_options_t*); extern ROCKSDB_LIBRARY_API void rocksdb_cache_destroy(rocksdb_cache_t* cache); extern ROCKSDB_LIBRARY_API void rocksdb_cache_disown_data( @@ -2014,11 +2014,11 @@ extern ROCKSDB_LIBRARY_API void rocksdb_cache_disown_data( extern ROCKSDB_LIBRARY_API void rocksdb_cache_set_capacity( rocksdb_cache_t* cache, size_t capacity); extern ROCKSDB_LIBRARY_API size_t -rocksdb_cache_get_capacity(rocksdb_cache_t* cache); +rocksdb_cache_get_capacity(const rocksdb_cache_t* cache); extern ROCKSDB_LIBRARY_API size_t -rocksdb_cache_get_usage(rocksdb_cache_t* cache); +rocksdb_cache_get_usage(const rocksdb_cache_t* cache); extern ROCKSDB_LIBRARY_API size_t -rocksdb_cache_get_pinned_usage(rocksdb_cache_t* cache); +rocksdb_cache_get_pinned_usage(const rocksdb_cache_t* cache); extern ROCKSDB_LIBRARY_API size_t rocksdb_cache_get_table_address_count(const rocksdb_cache_t* cache); extern ROCKSDB_LIBRARY_API size_t @@ -2046,7 +2046,8 @@ rocksdb_hyper_clock_cache_options_set_memory_allocator( extern ROCKSDB_LIBRARY_API rocksdb_cache_t* rocksdb_cache_create_hyper_clock( size_t capacity, size_t estimated_entry_charge); extern ROCKSDB_LIBRARY_API rocksdb_cache_t* -rocksdb_cache_create_hyper_clock_opts(rocksdb_hyper_clock_cache_options_t*); +rocksdb_cache_create_hyper_clock_opts( + const rocksdb_hyper_clock_cache_options_t*); /* DBPath */