179 std::unordered_map<Id_, OracularSubsettedSlabCacheSelectionDetails<Index_>*> my_close_future_subset_cache, my_far_future_subset_cache;
186 std::vector<std::tuple<Id_, Slab_*, const OracularSubsettedSlabCacheSelectionDetails<Index_>*> > my_to_populate;
195 my_total(my_oracle->total()),
201 my_close_future_subset_cache.reserve(
max_slabs);
202 my_far_future_subset_cache.reserve(
max_slabs);
204 my_all_subset_details.resize(
max_slabs * 2);
205 for (
auto&
as : my_all_subset_details) {
206 my_free_subset_details.push_back(&
as);
276 if (
slab_info.first == my_last_slab_id && my_last_slab) {
277 return std::make_pair(my_last_slab,
slab_info.second);
282 if (my_counter - 1 == my_close_refresh_point) {
283 if (my_all_slabs.empty()) {
288 while (++my_close_refresh_point < my_total) {
289 auto future_index = my_oracle->get(my_close_refresh_point);
292 if (
cfcIt != my_close_future_subset_cache.end()) {
304 my_far_refresh_point = my_close_refresh_point;
306 my_close_refresh_point = my_far_refresh_point;
310 if (my_far_refresh_point < my_total) {
311 requisition_subset_far(my_far_slab_id, my_far_slab_offset);
314 while (++my_far_refresh_point < my_total) {
315 auto future_index = my_oracle->get(my_far_refresh_point);
318 if (
ffcIt != my_far_future_subset_cache.end()) {
332 for (
auto&
cf : my_close_future_subset_cache) {
333 auto cIt = my_current_cache.find(
cf.first);
334 if (
cIt == my_current_cache.end()) {
335 my_to_reassign.emplace_back(
cf.first,
cf.second);
337 my_future_cache[
cf.first] =
cIt->second;
338 my_current_cache.erase(
cIt);
343 auto cIt = my_current_cache.begin();
344 for (
auto a : my_to_reassign) {
346 if (
cIt == my_current_cache.end()) {
347 my_all_slabs.emplace_back(create());
354 OracularSubsettedSlabCache_internals::finalize_details(*(
a.second));
355 my_to_populate.emplace_back(
a.first,
slab_ptr,
a.second);
357 my_to_reassign.clear();
360 my_to_populate.clear();
370 my_current_cache.clear();
371 my_current_cache.swap(my_future_cache);
375 for (
auto&
cfc : my_close_future_subset_cache) {
376 my_free_subset_details.push_back(
cfc.second);
378 my_close_future_subset_cache.clear();
379 my_close_future_subset_cache.swap(my_far_future_subset_cache);
384 my_last_slab =
ccIt->second;
385 return std::make_pair(my_last_slab,
slab_info.second);