Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
folly
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
folly
Commits
6dca2b32
Commit
6dca2b32
authored
Jul 05, 2012
by
Tudor Bosman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(minor changes, part of unrelated diff)
Test Plan: no Reviewed By: philipp@fb.com FB internal diff: D512868
parent
53d4209f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
folly/Bits.h
folly/Bits.h
+4
-8
No files found.
folly/Bits.h
View file @
6dca2b32
...
...
@@ -528,8 +528,6 @@ BitIterator<BaseIter> findFirstSet(BitIterator<BaseIter> begin,
}
namespace
detail
{
template
<
class
T
,
class
Enable
=
void
>
struct
Unaligned
;
template
<
class
T
>
...
...
@@ -539,15 +537,13 @@ struct Unaligned<
T
value
;
}
__attribute__
((
packed
));
}
// namespace detail
/**
* Read an unaligned value of type T and return it.
*/
template
<
class
T
>
inline
T
loadUnaligned
(
const
void
*
p
)
{
static_assert
(
alignof
(
detail
::
Unaligned
<
T
>
)
==
1
,
"Invalid alignment"
);
return
static_cast
<
const
detail
::
Unaligned
<
T
>*>
(
p
)
->
value
;
static_assert
(
alignof
(
Unaligned
<
T
>
)
==
1
,
"Invalid alignment"
);
return
static_cast
<
const
Unaligned
<
T
>*>
(
p
)
->
value
;
}
/**
...
...
@@ -555,8 +551,8 @@ inline T loadUnaligned(const void* p) {
*/
template
<
class
T
>
inline
void
storeUnaligned
(
void
*
p
,
T
value
)
{
static_assert
(
alignof
(
detail
::
Unaligned
<
T
>
)
==
1
,
"Invalid alignment"
);
static_cast
<
detail
::
Unaligned
<
T
>*>
(
p
)
->
value
=
value
;
static_assert
(
alignof
(
Unaligned
<
T
>
)
==
1
,
"Invalid alignment"
);
static_cast
<
Unaligned
<
T
>*>
(
p
)
->
value
=
value
;
}
}
// namespace folly
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment