Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
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
protobuf
Commits
ad47ec50
Commit
ad47ec50
authored
Oct 03, 2018
by
cburdick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Used C++ style casts
parent
ccacd40c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
arena_impl.h
src/google/protobuf/arena_impl.h
+3
-3
No files found.
src/google/protobuf/arena_impl.h
View file @
ad47ec50
...
...
@@ -52,7 +52,7 @@ namespace internal {
inline
size_t
AlignUpTo8
(
size_t
n
)
{
// Align n to next multiple of 8 (from Hacker's Delight, Chapter 3.)
return
(
n
+
7
)
&
(
size_t
)
-
8
;
return
(
n
+
7
)
&
static_cast
<
size_t
>
(
-
8
)
;
}
// This class provides the core Arena memory allocation library. Different
...
...
@@ -306,8 +306,8 @@ class PROTOBUF_EXPORT ArenaImpl {
public
:
// kBlockHeaderSize is sizeof(Block), aligned up to the nearest multiple of 8
// to protect the invariant that pos is always at a multiple of 8.
static
const
size_t
kBlockHeaderSize
=
(
sizeof
(
Block
)
+
7
)
&
(
size_t
)
-
8
;
static
const
size_t
kSerialArenaSize
=
(
sizeof
(
SerialArena
)
+
7
)
&
(
size_t
)
-
8
;
static
const
size_t
kBlockHeaderSize
=
(
sizeof
(
Block
)
+
7
)
&
static_cast
<
size_t
>
(
-
8
)
;
static
const
size_t
kSerialArenaSize
=
(
sizeof
(
SerialArena
)
+
7
)
&
static_cast
<
size_t
>
(
-
8
)
;
static_assert
(
kBlockHeaderSize
%
8
==
0
,
"kBlockHeaderSize must be a multiple of 8."
);
static_assert
(
kSerialArenaSize
%
8
==
0
,
...
...
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