<commit_before>#include "clustering/immediate_consistency/branch/multistore.hpp"

#include "errors.hpp"
#include <boost/function.hpp>

#include "btree/parallel_traversal.hpp"
#include "clustering/immediate_consistency/branch/metadata.hpp"
#include "concurrency/cross_thread_signal.hpp"
#include "protocol_api.hpp"
#include "rpc/semilattice/joins/vclock.hpp"

template <class protocol_t>
multistore_ptr_t<protocol_t>::multistore_ptr_t(store_view_t<protocol_t> **_store_views,
                                               int num_store_views,
                                               const typename protocol_t::region_t &_region)
    : store_views(num_store_views),
      region(_region) {

    initialize(_store_views, _region);
}

template <class protocol_t>
multistore_ptr_t<protocol_t>::multistore_ptr_t(multistore_ptr_t<protocol_t> *inner,
                                               const typename protocol_t::region_t &_region)
    : store_views(inner->num_stores()),
      region(_region) {
    rassert(region_is_superset(inner->region, _region));

    initialize(inner->store_views.data(), _region);
}

template <class protocol_t>
void do_initialize(int i, store_view_t<protocol_t> **store_views, store_view_t<protocol_t> **_store_views, const typename protocol_t::region_t &_region) {
    rassert(store_views[i] == NULL);

    on_thread_t th(_store_views[i]->home_thread());

    // We do a region intersection because store_subview_t requires that the region mask be a subset of the store region.
    store_views[i] = new store_subview_t<protocol_t>(_store_views[i],
                                                     region_intersection(_region, _store_views[i]->get_region()));
}

template <class protocol_t>
void multistore_ptr_t<protocol_t>::initialize(store_view_t<protocol_t> **_store_views,
                                              const typename protocol_t::region_t &_region) THROWS_NOTHING {
    pmap(store_views.size(), boost::bind(do_initialize<protocol_t>, _1, store_views.data(), _store_views, boost::ref(_region)));
}

template <class protocol_t>
void do_destroy(int i, store_view_t<protocol_t> **store_views) {
    guarantee(store_views[i] != NULL);<commit_msg>Removed bad assertion about nullness of uninitialized array entry from do_initialize in multistore.cc.<commit_after>#include "clustering/immediate_consistency/branch/multistore.hpp"

#include "errors.hpp"
#include <boost/function.hpp>

#include "btree/parallel_traversal.hpp"
#include "clustering/immediate_consistency/branch/metadata.hpp"
#include "concurrency/cross_thread_signal.hpp"
#include "protocol_api.hpp"
#include "rpc/semilattice/joins/vclock.hpp"

template <class protocol_t>
multistore_ptr_t<protocol_t>::multistore_ptr_t(store_view_t<protocol_t> **_store_views,
                                               int num_store_views,
                                               const typename protocol_t::region_t &_region)
    : store_views(num_store_views),
      region(_region) {

    initialize(_store_views, _region);
}

template <class protocol_t>
multistore_ptr_t<protocol_t>::multistore_ptr_t(multistore_ptr_t<protocol_t> *inner,
                                               const typename protocol_t::region_t &_region)
    : store_views(inner->num_stores()),
      region(_region) {
    rassert(region_is_superset(inner->region, _region));

    initialize(inner->store_views.data(), _region);
}

template <class protocol_t>
void do_initialize(int i, store_view_t<protocol_t> **store_views, store_view_t<protocol_t> **_store_views, const typename protocol_t::region_t &_region) {
    on_thread_t th(_store_views[i]->home_thread());

    // We do a region intersection because store_subview_t requires that the region mask be a subset of the store region.
    store_views[i] = new store_subview_t<protocol_t>(_store_views[i],
                                                     region_intersection(_region, _store_views[i]->get_region()));
}

template <class protocol_t>
void multistore_ptr_t<protocol_t>::initialize(store_view_t<protocol_t> **_store_views,
                                              const typename protocol_t::region_t &_region) THROWS_NOTHING {
    pmap(store_views.size(), boost::bind(do_initialize<protocol_t>, _1, store_views.data(), _store_views, boost::ref(_region)));
}

template <class protocol_t>
void do_destroy(int i, store_view_t<protocol_t> **store_views) {
    guarantee(store_views[i] != NULL);
{'fraction_non_alphanumeric': 0.10562906481273829, 'fraction_numerical': 0.00044853106077595876, 'mean_word_length': 3.7396386822529224, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 20, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7246875', 'n_tokens_mistral': 1366, 'n_tokens_neox': 1346, 'n_words': 239}