Skip to content

Commit 9735fef

Browse files
committed
use gtl instead of phmap
1 parent 48bffd2 commit 9735fef

File tree

7 files changed

+13
-9
lines changed

7 files changed

+13
-9
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,3 +118,6 @@
118118
[submodule "docker/msvc-winsdk"]
119119
path = docker/msvc-winsdk
120120
url = ../docker-nanoserver-msvc-winsdk
121+
[submodule "3rdparty/gtl"]
122+
path = 3rdparty/gtl
123+
url = https://github.com/greg7mdp/gtl.git

3rdparty/gtl

Submodule gtl added at 6ad66cd

include/nbl/asset/utils/CDirQuantCacheBase.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <limits>
1111
#include <cmath>
1212

13-
#include "parallel-hashmap/parallel_hashmap/phmap_dump.h"
13+
#include "gtl/include/gtl/phmap_dump.hpp"
1414

1515

1616
#include "nbl/core/declarations.h"
@@ -488,7 +488,7 @@ class CDirQuantCacheBase : public virtual core::IReferenceCounted, public impl::
488488
template<E_FORMAT CacheFormat>
489489
static inline size_t getSerializedCacheSizeInBytes_impl(size_t capacity)
490490
{
491-
return 1u+sizeof(size_t)*2u+phmap::priv::Group::kWidth+(sizeof(typename cache_type_t<CacheFormat>::slot_type)+1u)*capacity;
491+
return 1u+sizeof(size_t)*2u+gtl::priv::Group::kWidth+(sizeof(typename cache_type_t<CacheFormat>::slot_type)+1u)*capacity;
492492
}
493493
template<E_FORMAT CacheFormat>
494494
static inline bool validateSerializedCache(const SBufferRange<const ICPUBuffer>& buffer)

include/nbl/asset/utils/phmap_deserialization.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class CBufferPhmapInputArchive
2828
}
2929

3030
template<typename V>
31-
typename std::enable_if<phmap::type_traits_internal::IsTriviallyCopyable<V>::value,bool>::type loadBinary(V* v)
31+
typename std::enable_if<gtl::type_traits_internal::IsTriviallyCopyable<V>::value,bool>::type loadBinary(V* v)
3232
{
3333
memcpy(reinterpret_cast<uint8_t*>(v), buffPtr, sizeof(V));
3434
buffPtr += sizeof(V);

include/nbl/asset/utils/phmap_serialization.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class CBufferPhmapOutputArchive
2828
}
2929

3030
template<typename V>
31-
typename std::enable_if<phmap::type_traits_internal::IsTriviallyCopyable<V>::value,bool>::type saveBinary(const V& v)
31+
typename std::enable_if<gtl::type_traits_internal::IsTriviallyCopyable<V>::value,bool>::type saveBinary(const V& v)
3232
{
3333
memcpy(bufferPtr, reinterpret_cast<const uint8_t*>(&v), sizeof(V));
3434
bufferPtr += sizeof(V);

include/nbl/core/decl/Types.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <vector>
2323
#include <utility>
2424
#include <iterator>
25-
#include <parallel-hashmap/parallel_hashmap/phmap.h>
25+
#include <gtl/include/gtl/phmap.hpp>
2626

2727
#include "nbl/core/memory/new_delete.h"
2828

@@ -62,7 +62,7 @@ template<typename K, class Compare=std::less<K>, class Allocator=allocator<K> >
6262
using set = std::set<K,Compare,Allocator>;
6363

6464
template<typename K,typename T, class Hash=std::hash<K>, class KeyEqual=std::equal_to<K>, class Allocator=allocator<std::pair<const K,T> > >
65-
using unordered_map = phmap::flat_hash_map<K,T,Hash,KeyEqual,Allocator>;
65+
using unordered_map = gtl::flat_hash_map<K, T, Hash, KeyEqual, Allocator>;
6666
//
6767
template<class Key,class T,class Hash,class KeyEqual,class Alloc,class Pred>
6868
unordered_map<Key,T,Hash,KeyEqual,Alloc>::size_type erase_if(unordered_map<Key,T,Hash,KeyEqual,Alloc>& c, Pred pred)
@@ -84,7 +84,7 @@ using unordered_multimap = std::unordered_multimap<K,T,Hash,KeyEqual,Allocator>;
8484
template<typename K, class Hash=std::hash<K>, class KeyEqual=std::equal_to<K>, class Allocator=allocator<K> >
8585
using unordered_multiset = std::unordered_multiset<K,Hash,KeyEqual,Allocator>;
8686
template<typename K, class Hash=std::hash<K>, class KeyEqual=std::equal_to<K>, class Allocator=allocator<K> >
87-
using unordered_set = phmap::flat_hash_set<K,Hash,KeyEqual,Allocator>;
87+
using unordered_set = gtl::flat_hash_set<K,Hash,KeyEqual,Allocator>;
8888

8989

9090
template<typename T, class Allocator=allocator<T> >

src/nbl/video/utilities/CAssetConverter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3721,7 +3721,7 @@ auto CAssetConverter::reserve(const SInputs& inputs) -> SReserveResult
37213721
auto pruneStaging = [&]<Asset AssetType>()->void
37223722
{
37233723
auto& stagingCache = std::get<SReserveResult::staging_cache_t<AssetType>>(retval.m_stagingCaches);
3724-
phmap::erase_if(stagingCache,[&retval](const auto& entry)->bool
3724+
gtl::erase_if(stagingCache,[&retval](const auto& entry)->bool
37253725
{
37263726
if (entry.first->getReferenceCount()==1)
37273727
{
@@ -5565,7 +5565,7 @@ ISemaphore::future_t<IQueue::RESULT> CAssetConverter::convert_impl(SReserveResul
55655565
auto checkDependents = [&]<Asset AssetType>()->void
55665566
{
55675567
auto& stagingCache = std::get<SReserveResult::staging_cache_t<AssetType>>(reservations.m_stagingCaches);
5568-
phmap::erase_if(stagingCache,[&](auto& item)->bool
5568+
gtl::erase_if(stagingCache,[&](auto& item)->bool
55695569
{
55705570
auto* pGpuObj = item.first;
55715571
// rescan all the GPU objects and find out if they depend on anything that failed, if so add to failure set

0 commit comments

Comments
 (0)