Merge branch 'master' of https://git.billsun.dev/bill/AQuery
This commit is contained in:
@@ -4,3 +4,4 @@
|
||||
#define Ops(o) template<typename T> vector_type<typename types::Coercion<_Ty, T>::type> operator##o(const vector_type<T>& r) { [[likely]] if (r.size == size) { return add(r); } else if (r.size == 1 || size == 1) { const bool lr = size == 1; const uint32_t& _size = lr ? r.size : size; const auto& _container = lr ? r.container : container; const auto& scalar = *(lr ? container : r.container); vector_type<typename types::Coercion<_Ty, T>::type> ret(_size); for (int i = 0; i < _size; ++i) ret[i] = _container[i] o scalar; return ret; } }
|
||||
#define Op(o, x) template<typename T> vector_type<typename types::Coercion<_Ty, T>::type> inline x(const vector_type<T>& r) { vector_type<typename types::Coercion<_Ty, T>::type> ret(size); for (int i = 0; i < size; ++i) ret[i] = container[i] o r[i]; return ret; }
|
||||
#define _Make_Ops(M) M(+, add) M(-, minus) M(*, multi) M(/, div) M(%, mod) M(&, and) M(|, or) M(^, xor)
|
||||
#define QUERY_DECLSPEC
|
||||
|
||||
+6
-3
@@ -1,7 +1,10 @@
|
||||
#pragma once
|
||||
#include <atomic>
|
||||
#ifndef QUERY_DECLSPEC
|
||||
#define QUERY_DECLSPEC
|
||||
#endif
|
||||
|
||||
class ScratchSpace {
|
||||
class QUERY_DECLSPEC ScratchSpace {
|
||||
public:
|
||||
void* ret;
|
||||
char* scratchspace;
|
||||
@@ -10,7 +13,7 @@ public:
|
||||
size_t capacity;
|
||||
size_t initial_capacity;
|
||||
void* temp_memory_fractions;
|
||||
|
||||
|
||||
//uint8_t status;
|
||||
// record maximum size
|
||||
constexpr static uint8_t Grow = 0x1;
|
||||
@@ -36,7 +39,7 @@ public:
|
||||
|
||||
|
||||
#ifndef __AQ_USE_THREADEDGC__
|
||||
class GC {
|
||||
class QUERY_DECLSPEC GC {
|
||||
private:
|
||||
size_t max_slots,
|
||||
interval, forced_clean,
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
#include "pch_msc.hpp"
|
||||
//#define TESTMAIN
|
||||
#define TESTMAIN
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <chrono>
|
||||
|
||||
+1
-1
@@ -151,7 +151,7 @@ public:
|
||||
}
|
||||
ColView<_Ty> operator [](vector_type<uint32_t>& idxs) const {
|
||||
return ColView<_Ty>(*this, std::move(idxs));
|
||||
}
|
||||
}
|
||||
ColView<_Ty> operator [](const vector_type<uint32_t>& idxs) const {
|
||||
return ColView<_Ty>(*this, idxs);
|
||||
}
|
||||
|
||||
@@ -96,6 +96,9 @@
|
||||
# define ANKERL_UNORDERED_DENSE_UNLIKELY(x) (x) // NOLINT(cppcoreguidelines-macro-usage)
|
||||
# endif
|
||||
|
||||
template<class Key, class Hash>
|
||||
class AQHashTable;
|
||||
|
||||
namespace ankerl::unordered_dense {
|
||||
inline namespace ANKERL_UNORDERED_DENSE_NAMESPACE {
|
||||
|
||||
@@ -418,6 +421,7 @@ public:
|
||||
using iterator = typename value_container_type::iterator;
|
||||
using const_iterator = typename value_container_type::const_iterator;
|
||||
using bucket_type = Bucket;
|
||||
friend class AQHashTable<Key, Hash>;
|
||||
|
||||
private:
|
||||
using value_idx_type = decltype(Bucket::m_value_idx);
|
||||
|
||||
@@ -474,6 +474,7 @@ public:
|
||||
explicit AQHashTable(uint32_t sz)
|
||||
: ankerl::unordered_dense::set<Key, Hash>{} {
|
||||
this->reserve(sz);
|
||||
this->m_values.reserve(sz);
|
||||
reversemap = static_cast<uint32_t *>(malloc(sizeof(uint32_t) * sz * 2));
|
||||
mapbase = reversemap + sz;
|
||||
ht_base = static_cast<uint32_t *>(calloc(sz, sizeof(uint32_t)));
|
||||
|
||||
Reference in New Issue
Block a user