Skip to content

Commit

Permalink
fix broken indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
kuron99 committed Jun 14, 2024
1 parent 42ea88c commit 96536fa
Show file tree
Hide file tree
Showing 18 changed files with 254 additions and 254 deletions.
20 changes: 10 additions & 10 deletions bench/malloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,23 +78,23 @@ void worker(const size_t thid, char& ready, const bool& start, const bool& quit,
#endif

/**
* tools used in experiments.
*/
* tools used in experiments.
*/
std::uint64_t local_res{0};

/**
* initialize source array.
*/
* initialize source array.
*/
std::unique_ptr<char[]> own_str(new char[FLAGS_alloc_size]); // NOLINT
/**
* c-style array NOLINT reasons : It wants to decide array size after compile. So it
* wants to use c-style array.
*/
* c-style array NOLINT reasons : It wants to decide array size after compile. So it
* wants to use c-style array.
*/
for (std::size_t i = 0; i < FLAGS_alloc_size; ++i) {
/**
* thid means that it creates unique str among thread.
* If you use more threads than CHAR_MAX, rewrite this part.
*/
* thid means that it creates unique str among thread.
* If you use more threads than CHAR_MAX, rewrite this part.
*/
own_str.get()[i] = static_cast<char>(thid);
}

Expand Down
8 changes: 4 additions & 4 deletions include/atomic_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ void storeRelease(type* ptr, type* val) {
template<typename type>
bool weakCompareExchange(type* ptr, type* expected, type* desired) {
/**
* Built-in Function: bool __atomic_compare_exchange_n
* (type *ptr, type *expected, type desired, bool weak, int success_memorder, int
* failure_memorder)
*/
* Built-in Function: bool __atomic_compare_exchange_n
* (type *ptr, type *expected, type desired, bool weak, int success_memorder, int
* failure_memorder)
*/
return __atomic_compare_exchange_n(ptr, expected, *desired, true, // NOLINT
__ATOMIC_ACQ_REL, __ATOMIC_ACQUIRE);
}
Expand Down
36 changes: 18 additions & 18 deletions include/base_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,14 @@ class base_node { // NOLINT
}

/**
* A virtual function is defined because It wants to distinguish the children class of
* the contents by using polymorphism. So this function is pure virtual function.
*/
* A virtual function is defined because It wants to distinguish the children class of
* the contents by using polymorphism. So this function is pure virtual function.
*/
virtual status destroy() = 0;

/**
* @details display function for analysis and debug.
*/
* @details display function for analysis and debug.
*/
virtual void display() = 0;

/**
Expand Down Expand Up @@ -165,9 +165,9 @@ class base_node { // NOLINT
}

/**
* @details init at @a pos as position.
* @param[in] pos This is a position (index) to be initialized.
*/
* @details init at @a pos as position.
* @param[in] pos This is a position (index) to be initialized.
*/
void init_base(const std::size_t pos) { set_key(pos, 0, 0); }

[[maybe_unused]] void init_base_member_range(const std::size_t start) {
Expand All @@ -177,15 +177,15 @@ class base_node { // NOLINT
}

/**
* @brief It locks this node.
* @pre It didn't lock by myself.
* @return void
*/
* @brief It locks this node.
* @pre It didn't lock by myself.
* @return void
*/
void lock() { version_.lock(); }

/**
* @pre This function is called by split.
*/
* @pre This function is called by split.
*/
[[nodiscard]] base_node* lock_parent() const {
base_node* p = get_parent();
for (;;) {
Expand Down Expand Up @@ -267,10 +267,10 @@ class base_node { // NOLINT
}

/**
* @brief It unlocks this node.
* @pre This node was already locked.
* @return void
*/
* @brief It unlocks this node.
* @pre This node was already locked.
* @return void
*/
void version_unlock() { version_.unlock(); }

[[maybe_unused]] void version_atomic_inc_vinsert() {
Expand Down
42 changes: 21 additions & 21 deletions include/border_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,26 +74,26 @@ static void create_interior_parent_of_border(border_node* const left,
left->set_version_root(false);
right->set_version_root(false);
/**
* create a new interior node p with children n, n'
*/
* create a new interior node p with children n, n'
*/
auto ni = new interior_node(); // NOLINT
ni->init_interior();
ni->set_version_root(true);
ni->set_version_inserting_deleting(true);
ni->lock();
/**
* process base node members
*/
* process base node members
*/
ni->set_key(0, right->get_key_slice_at(0), right->get_key_length_at(0));
/**
* process interior node members
*/
* process interior node members
*/
ni->set_child_at(0, left);
ni->set_child_at(1, right);
ni->n_keys_increment();
/**
* release interior parent to global.
*/
* release interior parent to global.
*/
left->set_parent(ni);
right->set_parent(ni);
*new_parent = ni;
Expand Down Expand Up @@ -282,13 +282,13 @@ static void border_split(tree_instance* ti, border_node* const border,

if (p->get_version_border()) {
/**
* parent is border node.
* The old border node which is before this split was root of the some layer.
* So it creates new interior nodes in the layer and insert its interior pointer
* to the (parent) border node.
* attention : The parent border node had this border node as one of the next_layer
* before the split. The pointer is exchanged for a new parent interior node.
*/
* parent is border node.
* The old border node which is before this split was root of the some layer.
* So it creates new interior nodes in the layer and insert its interior pointer
* to the (parent) border node.
* attention : The parent border node had this border node as one of the next_layer
* before the split. The pointer is exchanged for a new parent interior node.
*/
auto* pb = dynamic_cast<border_node*>(p);
interior_node* pi{};
create_interior_parent_of_border<interior_node, border_node>(
Expand All @@ -303,8 +303,8 @@ static void border_split(tree_instance* ti, border_node* const border,
return;
}
/**
* parent is interior node.
*/
* parent is interior node.
*/
#ifndef NDEBUG
if (p->get_version_deleted()) { LOG(ERROR) << log_location_prefix; }
#endif
Expand All @@ -315,17 +315,17 @@ static void border_split(tree_instance* ti, border_node* const border,
new_border->version_unlock();
if (pi->get_n_keys() == key_slice_length) {
/**
* interior full case, it splits and inserts.
*/
* interior full case, it splits and inserts.
*/
interior_split<interior_node, border_node>(
ti, pi, reinterpret_cast<base_node*>(new_border), // NOLINT
std::make_pair(new_border->get_key_slice_at(0),
new_border->get_key_length_at(0)));
return;
}
/**
* interior not-full case, it inserts.
*/
* interior not-full case, it inserts.
*/
new_border->set_parent(pi);
pi->template insert<border_node>(
new_border, std::make_pair(new_border->get_key_slice_at(0),
Expand Down
4 changes: 2 additions & 2 deletions include/border_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,8 @@ class alignas(CACHE_LINE_SIZE) border_node final : public base_node { // NOLINT
node_version64_body v = get_stable_version();
for (;;) {
/**
* It loads cnk atomically by get_cnk func.
*/
* It loads cnk atomically by get_cnk func.
*/
permutation perm{permutation_.get_body()};
std::size_t cnk = perm.get_cnk();
link_or_value* ret_lv{nullptr};
Expand Down
4 changes: 2 additions & 2 deletions include/epoch.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ class epoch_management {

private:
/**
* @todo consider wrap around. Wrap around after 23,397,696,694 days.
*/
* @todo consider wrap around. Wrap around after 23,397,696,694 days.
*/
static inline std::atomic<Epoch> epoch_{1}; // NOLINT
};

Expand Down
24 changes: 12 additions & 12 deletions include/garbage_collection.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ namespace yakushima {
class garbage_collection {
public:
/**
* @tparam interior_node
* @tparam border_node
* @attention Use a template class so that the dependency does not cycle.
*/
* @tparam interior_node
* @tparam border_node
* @attention Use a template class so that the dependency does not cycle.
*/
template<class interior_node, class border_node>
void fin() {
// for cache
Expand Down Expand Up @@ -56,21 +56,21 @@ class garbage_collection {
}

/**
* @tparam interior_node
* @tparam border_node
* @attention Use a template class so that the dependency does not cycle.
*/
* @tparam interior_node
* @tparam border_node
* @attention Use a template class so that the dependency does not cycle.
*/
template<class interior_node, class border_node>
void gc() {
gc_node<interior_node, border_node>();
gc_value();
}

/**
* @tparam interior_node
* @tparam border_node
* @attention Use a template class so that the dependency does not cycle.
*/
* @tparam interior_node
* @tparam border_node
* @attention Use a template class so that the dependency does not cycle.
*/
template<class interior_node, class border_node>
void gc_node() {
Epoch gc_epoch = get_gc_epoch();
Expand Down
12 changes: 6 additions & 6 deletions include/interface_get.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ get(tree_instance* ti, std::string_view key_view,
find_border(root, key_slice, key_slice_length, special_status);
if (special_status == status::WARN_RETRY_FROM_ROOT_OF_ALL) {
/**
* @a root is the root node of the some layer, but it was deleted.
* So it must retry from root of the all tree.
*/
* @a root is the root node of the some layer, but it was deleted.
* So it must retry from root of the all tree.
*/
goto retry_from_root; // NOLINT
}
constexpr std::size_t tuple_node_index = 0;
Expand All @@ -81,9 +81,9 @@ get(tree_instance* ti, std::string_view key_view,
if (v_at_fetch_lv.get_vsplit() != v_at_fb.get_vsplit() ||
(v_at_fetch_lv.get_deleted() && !v_at_fetch_lv.get_root())) {
/**
* The correct border was changed between atomically fetching border node and
* atomically fetching lv.
*/
* The correct border was changed between atomically fetching border node and
* atomically fetching lv.
*/
goto retry_from_root; // NOLINT
}
if (lv_ptr == nullptr) {
Expand Down
4 changes: 2 additions & 2 deletions include/interface_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ namespace yakushima {

[[maybe_unused]] static void init() {
/**
* initialize thread information table (kThreadInfoTable)
*/
* initialize thread information table (kThreadInfoTable)
*/
thread_info_table::init();
epoch_manager::invoke_epoch_thread();
epoch_manager::invoke_gc_thread();
Expand Down
4 changes: 2 additions & 2 deletions include/interface_put.h
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ put([[maybe_unused]] Token token, tree_instance* ti, std::string_view key_view,
}
}
/**
* Here, lv_ptr has some next_layer.
*/
* Here, lv_ptr has some next_layer.
*/
root = lv_ptr->get_next_layer();
/**
* check whether border is still correct.
Expand Down
Loading

0 comments on commit 96536fa

Please sign in to comment.