Commit Graph

191 Commits

Author SHA1 Message Date
Stefan Eilemann f353fd8864 Fix pointer underrun when allocating large vectors
Change-Id: Ia69fc3098468eb64420215dc1068342ccbbb1ede
2015-02-13 10:35:08 -08:00
Hyungjin Kim c9a840e935 Change nested_root accessor to be const function.
The `<field>_nested_root()` is not viable from const object. (We usually get `const Monster *`.)

Change-Id: I0d0adcb38dd974318608417ee3094c34fb9c480d
2015-02-11 10:54:03 -08:00
Alex Ames 620fe1c5cf Merge "Call $(strip) on parameters so newlines work." into ub-games-master 2015-02-10 00:56:55 +00:00
Alex Ames 69dae32776 Call $(strip) on parameters so newlines work.
Added a call to $(strip) to the parameters of
`flatbuffers_header_build_rules` so that newlines can be used when
passing arguments to it.

Change-Id: Ie2149acebcef91d28ce2cb4bfd204a209b4c4e2f
2015-02-09 15:18:38 -08:00
franramirez688 da0f096ba2 Added biicode support via biicode.conf and CMake/biicode.cmake
Change-Id: Id9750cceaa57aad3c969cf12299aa60f21c29074
2015-02-09 14:57:17 -08:00
Wouter van Oortmerssen 36fe9d539f Merge "Clarified how to create a good pull request." into ub-games-master 2015-02-09 21:56:56 +00:00
Wouter van Oortmerssen 6180b5ac7a Merge "Reset minimum alignment when reusing FlatBufferBuilder" into ub-games-master 2015-02-09 17:16:38 +00:00
Wouter van Oortmerssen 42bfe240e0 Merge "added reuse option for root objects" into ub-games-master 2015-02-09 17:16:19 +00:00
Wouter van Oortmerssen 1fb0f1ef71 Clarified how to create a good pull request.
Updated CONTRIBUTING.md with some tips.

Change-Id: Id377621a98804293837fda25ef0758cf988eea37
2015-02-04 15:50:02 -08:00
Alex Ames 1c8c9438a2 Merge "Added new Android build target and makefile utils." into ub-games-master 2015-02-04 23:49:58 +00:00
Wouter van Oortmerssen 85f64786da Reset minimum alignment when reusing FlatBufferBuilder
Previously, if you were re-using instances of FlatBufferBuilder
and an earlier buffer would use a 64bit item where later ones
do not, you could be wasting space.

Change-Id: Ic8090a38f97ce73194e991ba72bcfae74a7ace9f
Tested: on Linux.
2015-02-04 15:30:47 -08:00
Florian Enner b0910e75e0 added reuse option for root objects
getRootAs..() function now has a second implementation that
accepts an existing object to allow object reuse, much like
all other methods that refer to objects.

Change-Id: Iffef567c903a130761ef7de98867e5465d29a04d
2015-02-04 15:30:07 -08:00
Alex Ames ff1ac8ab5a Added new Android build target and makefile utils.
Previously Android.mk only had a rule for the Flatbuffers test. There
is now an empty module definition so that flatbuffers can be included
as an Android module in other projects.

Additionally, android/jni/include.mk has been added which contains
some utility functions that can be used by projects using Flatbuffers
to generate header build rules and set up dependencies.

A sample project has been added to the samples directory to
demonstrate how to use flatbuffers with Android.

Tested by compiling Android project on Linux.

Change-Id: I25d6da40f6531777b22f7371187e0a2f4e903ad4
2015-02-04 14:39:53 -08:00
pjulien 4d3db99283 Issue #136
The satellite data of the ``ByteBuffer`` cannot be modified in
any way and stay thread safe in the presence of concurrent readers.

This implementation is simple and does introduce an allocation, however
without it multiple readers will quickly and continuously encounter
``IndexOutOfBoundsException`` exceptions.

An alternative, but possibly more controversial, implementation would
be to use ``Unsafe``.  Using ``Unsafe``, it's possible to do an
array copy with a provided buffer index.

Change-Id: I851d4034e753b3be2931ee2249ec2c82dde43135
2015-02-04 13:53:02 -08:00
Florian Enner 72b9501e69 Added force-defaults to Java bindings
Change-Id: I62d10b639112788be3b0f670280bd50ef9fcf094
2015-02-02 14:04:22 -08:00
Florian Enner 9c169083ad Added FlatBufferBuilder reuse
init resets internal variables, but keeps memory that has been allocated
for temporary storage

Change-Id: If2aa7d27de3c2717cf4c82b1e4e4b6732e495cea
2015-02-02 14:02:22 -08:00
Wouter van Oortmerssen 7bebaab69e Added "raw struct" results to benchmark.
Change-Id: I95c550df7019645b02417259522c7049865997cc
Tested: on Windows.
2015-02-02 14:02:21 -08:00
Gabriel Martinez d8117bb8a3 Merge "Add options to print build rule dependencies" into ub-games-master 2015-02-02 17:01:39 +00:00
Gabriel Martinez df4909e5f6 Add options to print build rule dependencies
Tested: on Linux

Bug: 16465909
Change-Id: I2f1a6def13e47716110426b00990c2c625c03251
2015-01-28 11:27:05 -08:00
Wouter van Oortmerssen 79c2d80ed4 Fix for previous Java commit.
optimization would cause vtable fields from previous tables to be written.

Bug: 19046968
Change-Id: I781f7bcbceeaec0b499d4f1e4e5e8a1e750e0707
Tested: on Linux.
2015-01-26 14:12:20 -08:00
Wouter van Oortmerssen 3e1b789d21 Applied Java namespace filename fix to Go.
Bug: 19067493
Change-Id: Ib32fef963306e27834c15e3bbabc60570924c1a9
Tested: on Linux.
2015-01-26 13:45:33 -08:00
Wouter van Oortmerssen cf7135ff58 Reducing garbage produced by Java serializer.
startObject() now only allocates a new vtable array when it needs to grow.

Tested: on Linux.

Change-Id: Idd041605afcb9487a34d63bda067172d797f437a
2015-01-26 13:35:20 -08:00
Wouter van Oortmerssen f60276f54b Fixed flatc not writing Java files without namespace.
If the schema didn't contain a namespace, paths would contain a
leading /, causing files not to be written.

Change-Id: I508772cbf6d18d464ef7d9f8842d0dbff14358a3
Tested: on Linux.
Bug: 19067493
2015-01-26 13:08:44 -08:00
pjulien 2b01247b30 PR for issue #130. Improves the javadoc of ``FlatBufferBuilder``
and marks ``dataStart`` deprecated.

Change-Id: I48409e20948117c5cf17a1bfabecf64b033eab27
2015-01-26 13:08:44 -08:00
Hiroshi Matsunaga 7cf74cb864 cursor_ is not directly represent the hexadecimal
Change-Id: Ibdbd0e2f85284c1443403ed8c43acbd6e9de635f
2015-01-26 13:08:44 -08:00
Wouter van Oortmerssen 4fb5a764df Support for booleans in the Java/C# API
Change-Id: I72e92183a7b5f4145ea51fcec29257dc9553a461
2015-01-26 13:08:44 -08:00
Wouter van Oortmerssen 6c2dc41e0d Parser will allow a table or vector to have a trailing comma.
Unless in --strict-json mode.
Also added strict_json option to the parser, which in
addition controls if field names without quotes are allowed.

Change-Id: Id56fe5c780bdb9170958050ffa8fa23cf2babe95
Tested: on Linux.
2015-01-21 11:18:01 -08:00
Wouter van Oortmerssen e568f17096 Fixed C# SizedByteArray copying leading bytes of ByteBuffer.
Tested: on Windows.

Change-Id: I946dacf799eae835ec041ea759622f74b0384937
2015-01-16 15:36:25 -08:00
Patrick Julien 1263e9788e Add a simple Maven file modeled after
https://github.com/google/protobuf/blob/master/java/pom.xml

This isn't good enough to publish to Maven Central but will at
least allow users to publish to their local maven repository
using 'mvn install'

Change-Id: I91ea146cf7c5263fcf5d9823f70bb1ef0158f9a6
Tested: 'mvn install' runs succesfully and produces a .jar
2015-01-16 11:39:23 -08:00
Patrick Julien f5132b9ee1 Ignore intellij files
Change-Id: I34ea778fc791ecce3a8948de51dea6fe4389a3c6
2015-01-16 11:09:06 -08:00
Patrick Julien c95ad9cc55 Reuse the same charset instance
Change-Id: I58b411a2c0f1ee6b856d5b1eaa42787036da1384
2015-01-16 11:05:58 -08:00
Wouter van Oortmerssen 3550899987 Sorted Vector & binary search functionality.
Bug: 16659276
Tested: on Linux & Windows.

Change-Id: Ie7a73810345fad4cf0a3ad03dfaa5464e3ed5ac8
2015-01-16 10:59:52 -08:00
Wouter van Oortmerssen 73582b145c Fixed C# showing up as C in the documentation
Change-Id: Id1cc75cee07fa2d3de3e7d346f6e2641e4692968
2015-01-07 16:30:10 -08:00
Wouter van Oortmerssen b929c62c71 Added clarification about unions in JSON to the docs.
Change-Id: I1f310636f8b74366b5b0fc73c7e106424583fc93
2015-01-07 15:42:43 -08:00
Leander Bessa Beernaert 3ec8d7f598 Added option FLATBUFFERS_BUILD_FLATC
When FLATBUFFERS_BUILD_FLATC is set to OFF, the flatbuffer compiler
and tests will not be build.

Change-Id: I42b87b71daab4cb9c06605c813e7e4b62d6bf67a
2015-01-07 15:41:59 -08:00
Wouter van Oortmerssen 352b743c71 Union verification functions were not correctly namespaced.
Bug: 18908613
Change-Id: Ifed8a33b6b976b64eed9d190d930b08de1d5f41e
Tested: on Linux.
2015-01-07 13:37:25 -08:00
Wouter van Oortmerssen b7cb91c34e Made CreateUninitializedVector return the buffer.
Previously, obtaining the buffer was unclear and required multiple
casts.

Change-Id: I18e01c9e669886ac250e83aad10623cbddd629b6
Tested: on Linux.
2015-01-07 13:37:25 -08:00
Wouter van Oortmerssen f79cc460f8 Merge changes Id7618e53,Ieddc3c5c into ub-games-master
* changes:
  non-generic version of CreateUninitializedVector for c ffi
  cast literal to csize to fix error
2015-01-07 19:25:59 +00:00
Jon Simantov 757854a6cd Merge "C#: Allow ByteBuffer to use faster unsafe mode" into ub-games-master 2015-01-07 19:07:03 +00:00
dyu 6f4b4c80a7 non-generic version of CreateUninitializedVector for c ffi
Change-Id: Id7618e53797a158b82e7e480a6507887db3528bc
2015-01-07 10:47:26 -08:00
dyu ae1763e226 cast literal to csize to fix error
Change-Id: Ieddc3c5cd4f7c97a9739ae3046b8a1b328180ae1
2015-01-07 10:47:19 -08:00
dyu aa46f0e4c2 update generated sources
Change-Id: I531c26572fca7fca9805178971d7e110d44627d8
2015-01-07 10:34:17 -08:00
Wouter van Oortmerssen 89d2b0861b Documentation clarifications.
Change-Id: I7dc4bb3bbe32c6fe83a013790391fba0df8f4888
2015-01-07 10:34:17 -08:00
Jon Simantov 4390254e6a C#: Allow ByteBuffer to use faster unsafe mode
If your C# runtime environment supports unsafe mode, you can use
the #define UNSAFE_BYTEBUFFER setting and build the FlatBuffers assembly
in unsafe mode for greatly increased performance.

Tested: Tested FlatBuffersTest on Windows using VS2010 with both safe
and unsafe versions. Added ByteBufferTest to test the byte reversing
functions.

Change-Id: I21334468b339334f9abf4317e6291b648b97f57b
2015-01-06 12:39:17 -08:00
Wouter van Oortmerssen 3a27013732 Merge "Added CONTRIBUTING.md file." into ub-games-master 2014-12-09 02:03:07 +00:00
Wouter van Oortmerssen d72c478128 Merge "Added VectorLength helper function that works on nullptr." into ub-games-master 2014-12-09 02:01:31 +00:00
Wouter van Oortmerssen 10f4ecac26 Merge "Fixed missing virtual destructor in allocator." into ub-games-master 2014-12-09 02:01:21 +00:00
Wouter van Oortmerssen 27823d5552 Merge "Fixed Java ByteBuffer accessors generated for non-scalar vectors." into ub-games-master 2014-12-09 02:01:12 +00:00
Wouter van Oortmerssen 19361a58ec Merge "Generate C++ function returning the file_identifier of a flatbuffer" into ub-games-master 2014-12-09 02:00:58 +00:00
Wouter van Oortmerssen c6c8a9ba29 Merge "Various documentation clarifications." into ub-games-master 2014-12-09 02:00:47 +00:00