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
be11d2b6
Commit
be11d2b6
authored
Dec 12, 2015
by
Oli Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
C# performance optimization to Pad/Prep methods
parent
b8187e5b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
ByteBuffer.cs
net/FlatBuffers/ByteBuffer.cs
+7
-0
FlatBufferBuilder.cs
net/FlatBuffers/FlatBufferBuilder.cs
+2
-4
No files found.
net/FlatBuffers/ByteBuffer.cs
View file @
be11d2b6
...
...
@@ -146,6 +146,13 @@ namespace FlatBuffers
_buffer
[
offset
]
=
value
;
}
public
void
PutByte
(
int
offset
,
byte
value
,
int
count
)
{
AssertOffsetAndLength
(
offset
,
sizeof
(
byte
)
*
count
);
for
(
var
i
=
0
;
i
<
count
;
++
i
)
_buffer
[
offset
+
i
]
=
value
;
}
// this method exists in order to conform with Java ByteBuffer standards
public
void
Put
(
int
offset
,
byte
value
)
{
...
...
net/FlatBuffers/FlatBufferBuilder.cs
View file @
be11d2b6
...
...
@@ -69,10 +69,7 @@ namespace FlatBuffers
public
void
Pad
(
int
size
)
{
for
(
var
i
=
0
;
i
<
size
;
i
++)
{
_bb
.
PutByte
(--
_space
,
0
);
}
_bb
.
PutByte
(
_space
-=
size
,
0
,
size
);
}
// Doubles the size of the ByteBuffer, and copies the old data towards
...
...
@@ -116,6 +113,7 @@ namespace FlatBuffers
_space
+=
(
int
)
_bb
.
Length
-
oldBufSize
;
}
if
(
alignSize
>
0
)
Pad
(
alignSize
);
}
...
...
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