6namespace sysio {
namespace chain {
42 if (
value & 0x00000000FFFFFFFFULL) lz -= 32;
43 if (
value & 0x0000FFFF0000FFFFULL) lz -= 16;
44 if (
value & 0x00FF00FF00FF00FFULL) lz -= 8;
45 if (
value & 0x0F0F0F0F0F0F0F0FULL) lz -= 4;
46 if (
value & 0x3333333333333333ULL) lz -= 2;
47 if (
value & 0x5555555555555555ULL) lz -= 1;
60 if (node_count == 0) {
67template<
typename ContainerA,
typename ContainerB>
68inline void move_nodes(ContainerA& to,
const ContainerB& from) {
70 to.insert(to.begin(), from.begin(), from.end());
73template<
typename Container>
75 to = std::forward<Container>(from);
94template<
typename DigestType,
template<
typename ...>
class Container =
vector,
typename ...Args>
106 template<
typename Allocator, std::enable_if_t<!std::is_same<std::decay_t<Allocator>, incremental_merkle_impl>::value,
int> = 0>
169 bool partial =
false;
171 auto current_depth = max_depth - 1;
176 updated_active_nodes.reserve(max_depth);
178 while (current_depth > 0) {
179 if (!(index & 0x1)) {
186 updated_active_nodes.emplace_back(top);
197 const auto& left_value = *active_iter;
203 updated_active_nodes.emplace_back(left_value);
216 updated_active_nodes.emplace_back(top);
Concept for allocating, resizing and freeing memory block.
incremental_merkle_impl & operator=(const incremental_merkle_impl &)=default
const DigestType & append(const DigestType &digest)
Container< DigestType, Args... > _active_nodes
DigestType get_root() const
incremental_merkle_impl(Allocator &&alloc)
incremental_merkle_impl(const incremental_merkle_impl &)=default
incremental_merkle_impl()
incremental_merkle_impl(incremental_merkle_impl &&)=default
fc::sha256 digest(const T &value)
constexpr int calcluate_max_depth(uint64_t node_count)
constexpr int clz_power_2(uint64_t value)
constexpr uint64_t next_power_of_2(uint64_t value)
void move_nodes(ContainerA &to, const ContainerB &from)
incremental_merkle_impl< digest_type, shared_vector > shared_incremental_merkle
incremental_merkle_impl< digest_type > incremental_merkle
auto make_canonical_pair(const digest_type &l, const digest_type &r)
#define FC_REFLECT(TYPE, MEMBERS)
Specializes fc::reflector for TYPE.
unsigned __int64 uint64_t