@@ -54,11 +54,11 @@ CacheAllocator<CacheTrait>::CacheAllocator(
5454 : config.memMonitoringEnabled ()},
5555 config_ (config.validate()),
5656 tempShm_ (type == InitMemType::kNone && isOnShm_
57- ? std::make_unique<TempShmMapping>(config_.size )
57+ ? std::make_unique<TempShmMapping>(config_.getCacheSize() )
5858 : nullptr ),
5959 shmManager_ (type != InitMemType::kNone
6060 ? std::make_unique<ShmManager>(config_.cacheDir,
61- config_.usePosixShm )
61+ config_.isUsingPosixShm() )
6262 : nullptr ),
6363 deserializer_ (type == InitMemType::kMemAttach ? createDeserializer()
6464 : nullptr ),
@@ -122,10 +122,10 @@ CacheAllocator<CacheTrait>::createNewMemoryAllocator() {
122122 return std::make_unique<MemoryAllocator>(
123123 getAllocatorConfig (config_),
124124 shmManager_
125- ->createShm (detail::kShmCacheName , config_.size ,
125+ ->createShm (detail::kShmCacheName , config_.getCacheSize () ,
126126 config_.slabMemoryBaseAddr , createShmCacheOpts ())
127127 .addr ,
128- config_.size );
128+ config_.getCacheSize () );
129129}
130130
131131template <typename CacheTrait>
@@ -137,7 +137,7 @@ CacheAllocator<CacheTrait>::restoreMemoryAllocator() {
137137 ->attachShm (detail::kShmCacheName , config_.slabMemoryBaseAddr ,
138138 createShmCacheOpts ())
139139 .addr ,
140- config_.size ,
140+ config_.getCacheSize () ,
141141 config_.disableFullCoredump );
142142}
143143
@@ -242,11 +242,12 @@ std::unique_ptr<MemoryAllocator> CacheAllocator<CacheTrait>::initAllocator(
242242 InitMemType type) {
243243 if (type == InitMemType::kNone ) {
244244 if (isOnShm_ == true ) {
245- return std::make_unique<MemoryAllocator>(
246- getAllocatorConfig (config_), tempShm_->getAddr (), config_.size );
245+ return std::make_unique<MemoryAllocator>(getAllocatorConfig (config_),
246+ tempShm_->getAddr (),
247+ config_.getCacheSize ());
247248 } else {
248249 return std::make_unique<MemoryAllocator>(getAllocatorConfig (config_),
249- config_.size );
250+ config_.getCacheSize () );
250251 }
251252 } else if (type == InitMemType::kMemNew ) {
252253 return createNewMemoryAllocator ();
@@ -2259,7 +2260,7 @@ PoolEvictionAgeStats CacheAllocator<CacheTrait>::getPoolEvictionAgeStats(
22592260template <typename CacheTrait>
22602261CacheMetadata CacheAllocator<CacheTrait>::getCacheMetadata() const noexcept {
22612262 return CacheMetadata{kCachelibVersion , kCacheRamFormatVersion ,
2262- kCacheNvmFormatVersion , config_.size };
2263+ kCacheNvmFormatVersion , config_.getCacheSize () };
22632264}
22642265
22652266template <typename CacheTrait>
0 commit comments