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
b59aafc6
Commit
b59aafc6
authored
Dec 07, 2016
by
Robert
Committed by
GitHub
Dec 07, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3791 from mmastrac/master
Avoid unsafe when sizing types
parents
92a6ae93
36daedf3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
18 deletions
+19
-18
sizes.go
go/sizes.go
+19
-18
No files found.
go/
unsafe
.go
→
go/
sizes
.go
View file @
b59aafc6
package
flatbuffers
import
"unsafe"
var
(
const
(
// See http://golang.org/ref/spec#Numeric_types
// SizeUint8 is the byte size of a uint8.
SizeUint8
=
int
(
unsafe
.
Sizeof
(
uint8
(
0
)))
SizeUint8
=
1
// SizeUint16 is the byte size of a uint16.
SizeUint16
=
int
(
unsafe
.
Sizeof
(
uint16
(
0
)))
SizeUint16
=
2
// SizeUint32 is the byte size of a uint32.
SizeUint32
=
int
(
unsafe
.
Sizeof
(
uint32
(
0
)))
SizeUint32
=
4
// SizeUint64 is the byte size of a uint64.
SizeUint64
=
int
(
unsafe
.
Sizeof
(
uint64
(
0
)))
SizeUint64
=
8
// SizeInt8 is the byte size of a int8.
SizeInt8
=
int
(
unsafe
.
Sizeof
(
int8
(
0
)))
SizeInt8
=
1
// SizeInt16 is the byte size of a int16.
SizeInt16
=
int
(
unsafe
.
Sizeof
(
int16
(
0
)))
SizeInt16
=
2
// SizeInt32 is the byte size of a int32.
SizeInt32
=
int
(
unsafe
.
Sizeof
(
int32
(
0
)))
SizeInt32
=
4
// SizeInt64 is the byte size of a int64.
SizeInt64
=
int
(
unsafe
.
Sizeof
(
int64
(
0
)))
SizeInt64
=
8
// SizeFloat32 is the byte size of a float32.
SizeFloat32
=
int
(
unsafe
.
Sizeof
(
float32
(
0
)))
SizeFloat32
=
4
// SizeFloat64 is the byte size of a float64.
SizeFloat64
=
int
(
unsafe
.
Sizeof
(
float64
(
0
)))
SizeFloat64
=
8
// SizeByte is the byte size of a byte.
// The `byte` type is aliased (by Go definition) to uint8.
SizeByte
=
SizeUint8
SizeByte
=
1
// SizeBool is the byte size of a bool.
// The `bool` type is aliased (by flatbuffers convention) to uint8.
SizeBool
=
SizeUint8
SizeBool
=
1
// SizeSOffsetT is the byte size of an SOffsetT.
SizeSOffsetT
=
int
(
unsafe
.
Sizeof
(
SOffsetT
(
0
)))
// The `SOffsetT` type is aliased (by flatbuffers convention) to int32.
SizeSOffsetT
=
4
// SizeUOffsetT is the byte size of an UOffsetT.
SizeUOffsetT
=
int
(
unsafe
.
Sizeof
(
UOffsetT
(
0
)))
// The `UOffsetT` type is aliased (by flatbuffers convention) to uint32.
SizeUOffsetT
=
4
// SizeVOffsetT is the byte size of an VOffsetT.
SizeVOffsetT
=
int
(
unsafe
.
Sizeof
(
VOffsetT
(
0
)))
// The `VOffsetT` type is aliased (by flatbuffers convention) to uint16.
SizeVOffsetT
=
2
)
// byteSliceToString converts a []byte to string without a heap allocation.
...
...
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