* add Name() for ForceCodec interface
// ForceCodec returns a CallOption that will set the given Codec to be
// used for all request and response messages for a call. The result of calling
// String() will be used as the content-subtype in a case-insensitive manner.
//
* Update grpc.go
As an example, GetInt64 used to perform 8 bounds checks, one for each
slice access. By performing a bound check on the highest index, the
number of checks is reduced to one through bounds-check-elimination.
This enables both WriteUint64 and WriteInt64 to both be inlined as
well as implemented with a single assembly instruction. The current Go
compiler refuses to inline functions with for loops. The compiler is
also not smart enough to produce a single assembly instruction for the
for-loop.
* Addition of Go FinishWithFileIdentifier, allows for Go flatbuffer data to contain a file identifier
* adding panic as per review if fileIdentifier does not match length, letting prep pad the file identifier
* updated error message to not use fmt.Sprintf
* using minalign for alignment for file identifier
This is something the format supports, but none of the builders
were doing. Can save 10-20% on FlatBuffer binary size!
Also fixed the Go tests.
Change-Id: I616c56ce9bbcfcaee23aa24f0532fcb60b6a8c75
Tested: on Linux.
This was causing build failures with tools dependent on Flatbuffers in Go.
E.g.
go/src/github.com/google/flatbuffers/go/sizes.go:50: undefined: unsafe in unsafe.Pointer
* support for grpc golang
* refactored grpc go generator
* added grpc-go test and refactored
* refactored idl_gen_grpc.cpp
* fixed grpc generate method name
* refactored flatc and fixed line length issue
* added codec to go lib and fixed formatting issues
* fixed spacing issues
Similar to what protobufs does with its `Message` interface, introduce here such interface and create a generic `GetRootAs` method to deserialize a flatbuffer.
+ Add state to the Builder object to track if we are inside a table,
and if we are finished building the buffer.
+ Use this data to check that a buffer is being built correctly.
+ Panic if a buffer is not being built correctly.
+ Test that the panics happen as expected.
Based on d236dea13d.
Also add a new `insideObject` boolean to the Builder to track whether an
object is currently being constructed. This fixes a bug with objects
that have zero fields.
Builder has a new CreateByteString function that writes a
null-terimnated byte slice to the buffer. This results in zero
allocations for writing strings.
This function gets around the inefficiency of populating a [ubyte] vector
byte by byte. Since ubyte vectors are probably the most commonly used type
of generic byte buffer, this seems like a worthwhile thing to create a
fast path for.
Benchmarks show a 6x improvement in throughput on x64.
There is a new test verifying the functionality of the function.
Change-Id: I82e0228ae0f815dd7ea89bf168b8c1925f3ce0d7
Implement code generation and runtime library for Go, derived from the
Java implementation. Additionally, the test suite verifies:
- the exact bytes in the Builder buffer during object construction,
- vtable deduplication, and
- table construction, via a fuzzer derived from the C++ implementation.
Change-Id: Ib95a019c684891def2b50281e570b4843fea7baa