File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,12 @@ NS_ASSUME_NONNULL_BEGIN
35
35
*/
36
36
+ (instancetype )LRUCacheWithCapacity : (size_t )capacity numShardsBits : (int )numShardBits ;
37
37
38
+
39
+ /* *
40
+ Removes all unreferenced entries from the cache.
41
+ */
42
+ - (void )eraseUnreferencedEntries ;
43
+
38
44
@end
39
45
40
46
NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change 9
9
#import " RocksDBCache.h"
10
10
11
11
#import < rocksdb/cache.h>
12
+ #import < rocksdb/advanced_cache.h>
12
13
13
14
@interface RocksDBCache ()
14
15
{
@@ -39,6 +40,15 @@ - (instancetype)initWithNativeCache:(std::shared_ptr<rocksdb::Cache>)cache
39
40
return self;
40
41
}
41
42
43
+ - (void )eraseUnreferencedEntries
44
+ {
45
+ @synchronized (self) {
46
+ if (_cache != nullptr ) {
47
+ _cache->EraseUnRefEntries ();
48
+ }
49
+ }
50
+ }
51
+
42
52
- (void )dealloc
43
53
{
44
54
@synchronized (self) {
You can’t perform that action at this time.
0 commit comments