Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Alchemy Viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Operate
Terraform modules
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
Alchemy Viewer
Alchemy Viewer
Commits
79032acf
Commit
79032acf
authored
4 years ago
by
Rye Mutt
Browse files
Options
Downloads
Patches
Plain Diff
Add support to LLUUID and LLMaterialID for robinhood
parent
6aab1e5e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
indra/llcommon/lluuid.h
+13
-9
13 additions, 9 deletions
indra/llcommon/lluuid.h
indra/llprimitive/llmaterialid.h
+33
-1
33 additions, 1 deletion
indra/llprimitive/llmaterialid.h
with
46 additions
and
10 deletions
indra/llcommon/lluuid.h
+
13
−
9
View file @
79032acf
...
...
@@ -35,6 +35,8 @@
#include
"llpreprocessor.h"
#include
<immintrin.h>
#include
<robin_hood.h>
class
LLMutex
;
const
S32
UUID_BYTES
=
16
;
...
...
@@ -177,15 +179,7 @@ class LL_COMMON_API LLUUID
inline
size_t
hash
()
const
{
size_t
seed
=
0
;
for
(
U8
i
=
0
;
i
<
4
;
++
i
)
{
seed
^=
static_cast
<
size_t
>
(
mData
[
i
*
4
])
+
0x9e3779b9
+
(
seed
<<
6
)
+
(
seed
>>
2
);
seed
^=
static_cast
<
size_t
>
(
mData
[
i
*
4
+
1
])
+
0x9e3779b9
+
(
seed
<<
6
)
+
(
seed
>>
2
);
seed
^=
static_cast
<
size_t
>
(
mData
[
i
*
4
+
2
])
+
0x9e3779b9
+
(
seed
<<
6
)
+
(
seed
>>
2
);
seed
^=
static_cast
<
size_t
>
(
mData
[
i
*
4
+
3
])
+
0x9e3779b9
+
(
seed
<<
6
)
+
(
seed
>>
2
);
}
return
seed
;
return
robin_hood
::
hash_bytes
(
mData
,
UUID_BYTES
);
}
// END BOOST
...
...
@@ -271,6 +265,16 @@ namespace boost {
};
}
namespace
robin_hood
{
template
<
>
struct
hash
<
LLUUID
>
{
size_t
operator
()(
const
LLUUID
&
id
)
const
{
return
id
.
hash
();
}
};
}
/*
* Sub-classes for keeping transaction IDs and asset IDs
* straight.
...
...
This diff is collapsed.
Click to expand it.
indra/llprimitive/llmaterialid.h
+
33
−
1
View file @
79032acf
...
...
@@ -33,6 +33,8 @@
#include
<immintrin.h>
#include
"llsd.h"
#include
<robin_hood.h>
class
LLMaterialID
{
public:
...
...
@@ -147,7 +149,7 @@ class LLMaterialID
seed
^=
static_cast
<
size_t
>
(
mID
[
i
*
4
+
2
])
+
0x9e3779b9
+
(
seed
<<
6
)
+
(
seed
>>
2
);
seed
^=
static_cast
<
size_t
>
(
mID
[
i
*
4
+
3
])
+
0x9e3779b9
+
(
seed
<<
6
)
+
(
seed
>>
2
);
}
return
seed
;
return
robin_hood
::
hash_bytes
(
mID
,
MATERIAL_ID_SIZE
)
;
}
// END BOOST
...
...
@@ -168,5 +170,35 @@ class LLMaterialID
U8
mID
[
MATERIAL_ID_SIZE
]
=
{};
}
;
namespace
std
{
template
<
>
struct
hash
<
LLMaterialID
>
{
size_t
operator
()(
const
LLMaterialID
&
id
)
const
{
return
id
.
hash
();
}
};
}
namespace
boost
{
template
<
>
struct
hash
<
LLMaterialID
>
{
size_t
operator
()(
const
LLMaterialID
&
id
)
const
{
return
id
.
hash
();
}
};
}
namespace
robin_hood
{
template
<
>
struct
hash
<
LLMaterialID
>
{
size_t
operator
()(
const
LLMaterialID
&
id
)
const
{
return
id
.
hash
();
}
};
}
#endif // LL_LLMATERIALID_H
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment