Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
brpc
Commits
7164f224
Commit
7164f224
authored
Sep 17, 2019
by
niukuo
Committed by
yiteng.nyt
Sep 23, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix compile error on arm64
parent
fc831f28
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
7 deletions
+13
-7
processor.h
src/bthread/processor.h
+6
-0
snappy-internal.h
src/butil/third_party/snappy/snappy-internal.h
+1
-1
snappy-stubs-internal.h
src/butil/third_party/snappy/snappy-stubs-internal.h
+6
-6
No files found.
src/bthread/processor.h
View file @
7164f224
...
...
@@ -23,9 +23,15 @@
#ifndef BTHREAD_PROCESSOR_H
#define BTHREAD_PROCESSOR_H
#include "butil/build_config.h"
// Pause instruction to prevent excess processor bus usage, only works in GCC
# ifndef cpu_relax
#if defined(ARCH_CPU_ARM_FAMILY)
# define cpu_relax() asm volatile("yield\n": : :"memory")
#else
# define cpu_relax() asm volatile("pause\n": : :"memory")
#endif
# endif
// Compile read-write barrier
...
...
src/butil/third_party/snappy/snappy-internal.h
View file @
7164f224
...
...
@@ -132,7 +132,7 @@ static inline int FindMatchLength(const char* s1,
matched
+=
4
;
}
if
(
LittleEndian
::
IsLittleEndian
()
&&
s2
<=
s2_limit
-
4
)
{
uint32
x
=
UNALIGNED_LOAD32
(
s2
)
^
UNALIGNED_LOAD32
(
s1
+
matched
);
uint32
_t
x
=
UNALIGNED_LOAD32
(
s2
)
^
UNALIGNED_LOAD32
(
s1
+
matched
);
int
matching_bits
=
Bits
::
FindLSBSetNonZero
(
x
);
matched
+=
matching_bits
>>
3
;
}
else
{
...
...
src/butil/third_party/snappy/snappy-stubs-internal.h
View file @
7164f224
...
...
@@ -114,13 +114,13 @@ namespace snappy {
// See if that would be more efficient on platforms supporting it,
// at least for copies.
inline
uint64_tUNALIGNED_LOAD64
(
const
void
*
p
)
{
uint64_tt
;
inline
uint64_t
UNALIGNED_LOAD64
(
const
void
*
p
)
{
uint64_t
t
;
memcpy
(
&
t
,
p
,
sizeof
t
);
return
t
;
}
inline
void
UNALIGNED_STORE64
(
void
*
p
,
uint64_tv
)
{
inline
void
UNALIGNED_STORE64
(
void
*
p
,
uint64_t
v
)
{
memcpy
(
p
,
&
v
,
sizeof
v
);
}
...
...
@@ -141,8 +141,8 @@ inline uint32_t UNALIGNED_LOAD32(const void *p) {
return
t
;
}
inline
uint64_tUNALIGNED_LOAD64
(
const
void
*
p
)
{
uint64_tt
;
inline
uint64_t
UNALIGNED_LOAD64
(
const
void
*
p
)
{
uint64_t
t
;
memcpy
(
&
t
,
p
,
sizeof
t
);
return
t
;
}
...
...
@@ -155,7 +155,7 @@ inline void UNALIGNED_STORE32(void *p, uint32_t v) {
memcpy
(
p
,
&
v
,
sizeof
v
);
}
inline
void
UNALIGNED_STORE64
(
void
*
p
,
uint64_tv
)
{
inline
void
UNALIGNED_STORE64
(
void
*
p
,
uint64_t
v
)
{
memcpy
(
p
,
&
v
,
sizeof
v
);
}
...
...
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