Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
flatbuffers
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
flatbuffers
Commits
5cee340a
Commit
5cee340a
authored
Jan 16, 2018
by
Wouter van Oortmerssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleaned up FlatBufferBuilder clearing.
Change-Id: I81cf4d268670bdd11d1d56ca9f2de78c120df842 Tested: on Linux.
parent
f0769b60
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
10 deletions
+9
-10
flatbuffers.h
include/flatbuffers/flatbuffers.h
+9
-10
No files found.
include/flatbuffers/flatbuffers.h
View file @
5cee340a
...
...
@@ -538,23 +538,23 @@ class vector_downward {
if
(
buf_
)
{
assert
(
allocator_
);
allocator_
->
deallocate
(
buf_
,
reserved_
);
buf_
=
nullptr
;
}
reserved_
=
0
;
buf_
=
nullptr
;
cur_
=
nullptr
;
scratch_
=
nullptr
;
clear
();
}
void
clear
()
{
if
(
buf_
)
{
cur_
=
buf_
+
reserved_
;
scratch_
=
buf_
;
}
else
{
reserved_
=
0
;
buf_
=
nullptr
;
cur_
=
nullptr
;
scratch_
=
nullptr
;
}
clear_scratch
();
}
void
clear_scratch
()
{
scratch_
=
buf_
;
}
// Relinquish the pointer to the caller.
...
...
@@ -563,10 +563,8 @@ class vector_downward {
size
());
allocator_
=
nullptr
;
own_allocator_
=
false
;
reserved_
=
0
;
buf_
=
nullptr
;
cur_
=
nullptr
;
scratch_
=
nullptr
;
clear
();
return
fb
;
}
...
...
@@ -1534,6 +1532,7 @@ class FlatBufferBuilder {
void
Finish
(
uoffset_t
root
,
const
char
*
file_identifier
,
bool
size_prefix
)
{
NotNested
();
buf_
.
clear_scratch
();
// This will cause the whole buffer to be aligned.
PreAlign
((
size_prefix
?
sizeof
(
uoffset_t
)
:
0
)
+
sizeof
(
uoffset_t
)
+
(
file_identifier
?
kFileIdentifierLength
:
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