Commit Graph

3267 Commits

Author SHA1 Message Date
Thomas Van Lenten
92091363cd Merge pull request #1339 from thomasvl/delay_dispatch_semaphore_creation
Only create the readonlySemaphore on demand.
2016-03-21 13:57:14 -04:00
Thomas Van Lenten
bd41a39f69 Only create the readonlySemaphore on demand.
This will lower the amount of dispatch_semaphores created per Message when the
full object tree isn't walked in a way that would require them to be created.
Uses a dispatch_once_t for one time init of the dispatch_semaphore.
2016-03-21 11:11:14 -04:00
Thomas Van Lenten
5e933847cc Merge pull request #1325 from thomasvl/shrink_overhead
Shrink ObjC overhead (generated size and some runtime sizes)
2016-03-17 17:06:33 -04:00
Thomas Van Lenten
79a23c435c Shrink ObjC overhead (generated size and some runtime sizes)
NOTE: This is a binary breaking change as structure sizes have changed size
and/or order.

- Drop capturing field options, no other options were captured and other mobile
  targeted languages don't try to capture this sort information (saved 8
  bytes for every field defined (in static data and again in field descriptor
  instance size data).
- No longer generate/compile in the messages/enums in descriptor.proto. If
  developers need it, they should generate it and compile it in. Reduced the
  overhead of the core library.
- Compute the number of has_bits actually needs to avoid over reserving.
- Let the boolean single fields store via a has_bit to avoid storage, makes
  the common cases of the instance size smaller.
- Reorder some flags and down size the enums to contain the bits needed.
- Reorder the items in the structures to manually ensure they are are packed
  better (especially when generating 64bit code - 8 bytes for every field,
  16 bytes for every extension, instance sizes 8 bytes also).
- Split off the structure initialization so when the default is zero, the
  generated static storage doesn't need to reserve the space. This is batched
  at the message level, so all the fields for the message have to have zero
  defaults to get the saves. By definition all proto3 syntax  files fall into
  this case but it also saves space for the proto2 that use the standard
  defaults. (saves 8 bytes of static data for every field that had a zero
  default)
- Don't track the enums defined by a message. Nothing in the runtime needs it
  and it was just generation and runtime overhead. (saves 8 bytes per enum)
- Ensure EnumDescriptors are started up threadsafe in all cases.
- Split some of the Descriptor initialization into multiple methods so the
  generated code isn't padded with lots of zero/nil args.
- Change how oneof info is feed to the runtime enabling us to generate less
  static data (8 bytes saved per oneof for 64bit).
- Change how enum value informat is capture to pack the data and only decode
  it if it ends up being needed. Avoids padding issues causing bloat of 64bit,
  and removes the needs for extra pointers in addition to the data (just the
  data and one pointer now).
2016-03-17 10:04:21 -04:00
Feng Xiao
ca3dc15d4c Merge pull request #1318 from smparkes/smparkes/grpc
add java/util support based on java/util/pom.xml
2016-03-14 14:57:33 -07:00
Thomas Van Lenten
44fdead9d2 Merge pull request #1291 from sergiocampama/devel
Adds more information to Objective C error.
2016-03-14 10:07:05 -04:00
Jisi Liu
9aea0ef0cd Merge pull request #1312 from petewarden/master
Bazel iOS build settings
2016-03-12 15:15:03 -08:00
Steven Parkes
a9244ca0df add java/util support based on java/util/pom.xml 2016-03-11 18:08:09 -08:00
Jisi Liu
c71f1847c8 Merge pull request #1278 from smparkes/master
pass correct args to protoc for wellknown protos when used as an external repository
2016-03-11 16:58:15 -08:00
Feng Xiao
dfaf1aac30 Merge pull request #1317 from benvanik/patch-1
Fixing compilation error when building with emscripten.
2016-03-11 12:10:06 -08:00
Ben Vanik
58f07644ea Fixing compilation error when building with emscripten.
This change was previously done in //third_party in CL 108656107 but never made it to the open source project and was overwritten in an update.
2016-03-11 09:19:58 -08:00
Steven Parkes
ea1886661e pass correct args to protoc for java wellknown protos when used as an external repository 2016-03-10 15:04:46 -08:00
Pete Warden
bc2d6c2504 Merge remote-tracking branch 'upstream/master' 2016-03-09 13:05:15 -08:00
Pete Warden
f0c1a86372 Added iOS settings to Bazel build 2016-03-09 13:03:52 -08:00
Feng Xiao
48ebb29a8e Merge pull request #1299 from tatraian/master
Fix compiling clang/libc++ builds. (Issue: #1266)
2016-03-08 11:15:24 -08:00
Antal Tátrai
e2fb1d9822 Comment has been added to fix (issue #1266) 2016-03-08 20:01:42 +01:00
Thomas Van Lenten
a8db268d8f Merge pull request #1309 from thomasvl/leading_special_prop_names
Fix up handing of fields with leading names that should be all caps.
2016-03-08 09:30:37 -05:00
Thomas Van Lenten
1bf4b38f29 Fix up handing of fields with leading names that should be all caps.
Add a compile test to confirm things are working as expected.
2016-03-08 09:29:49 -05:00
Joshua Haberman
3dd3238189 Merge pull request #1306 from silviulica/master
Update version to 3.0.0b2.post2
2016-03-07 16:31:48 -08:00
Silviu Calinoiu
4573edba76 Update version to 3.0.0b2.post2 2016-03-07 14:33:57 -08:00
Thomas Van Lenten
6a8815bef9 Merge pull request #1304 from thomasvl/headerdocs
HeaderDoc support in the library and generated sources
2016-03-07 15:11:18 -05:00
Thomas Van Lenten
36650a07cf HeaderDoc support in the library and generated sources
- Convert most of the core library headers over to HeaderDoc format.
- Switch the generated comments over to HeaderDoc.
- Create GPBCodedOutputStream_PackagePrivate and move some things into there
  that should be more internal.
2016-03-07 12:07:03 -05:00
Jon Skeet
f2d3408676 Merge pull request #1301 from avgweb/master
Replace StringBuilder with TextWriter in JsonFormatter
2016-03-07 09:37:43 +00:00
avgweb
ad2d775e1b Replace StringBuilder with TextWriter in JsonFormatter 2016-03-06 17:50:02 -08:00
Joshua Haberman
9242d9b7f4 Merge pull request #1298 from craigcitro/fix_setup
Add back the namespace_packages arg in setup.py.
2016-03-05 13:33:24 -08:00
Antal Tátrai
3cc35adb6d Fix compiling clang/libc++ builds. (Issue: #1266) 2016-03-05 09:32:59 +01:00
Craig Citro
0e7c0c2fb8 Add back the namespace_packages arg in setup.py.
Improves #1296.

The problem: in the previous patch, we tweaked the __init__.py files to use
namespaces, but no longer declared ourselves as a namespace package. The
second half was unwise.

Note that this only comes up when installing protobuf alongside another
package that also installs into the google namespace; as of right now, the
only PyPI package that does is googleapis-common-protos, though the GAE SDK
also uses google.appengine. Installing either or both of those alongside this
package now works.

The case that still remains is the upgrade path, which is also what worried me
in #713. It seems that if protobuf 2.6.1 is installed, there's no way to
safely upgrade that to work with a newer protobuf. However, `pip uninstall` &&
`pip install` does the trick.
2016-03-05 00:10:11 -08:00
Joshua Haberman
e70f9256af Merge pull request #1139 from haberman/rubyjsoncamel
Changed Ruby to properly camelCase its JSON by default.
2016-03-04 17:31:11 -08:00
Joshua Haberman
37663e861b Merge pull request #1292 from haberman/ruby-allow-descriptor
Generate well-known types in Ruby extension and prune unneeded proto2 dependencies.
2016-03-04 13:09:25 -08:00
Josh Haberman
35227b4f31 Removed the generated Ruby file from Makefile.am. 2016-03-03 23:52:31 -08:00
Josh Haberman
513875da77 Generate well-known types in Ruby extension and prune unneeded proto2 dependencies. 2016-03-03 14:08:54 -08:00
Sergio Campama
b5a35b4411 Adds more information to Objective C error when the expected objc_class_prefix option is missing. 2016-03-03 16:49:53 -03:00
Paul Yang
78105897a8 Merge pull request #1260 from legrosbuffle/master
Make cpp generated enum constants constexpr when Options::proto_h is specified
2016-03-02 10:16:20 -08:00
Jon Skeet
584233bd04 Merge pull request #1287 from jskeet/fix-typo
Fix copy/paste typo in CodedInputStreamTest
2016-03-01 07:53:27 +00:00
Jon Skeet
f222a9a5e6 Fix copy/paste typo in CodedInputStreamTest 2016-03-01 07:30:40 +00:00
Joshua Haberman
52f62e3652 Merge pull request #1274 from murgatroid99/node_relative_requires
Fix CommonJS relative require generation, and test it
2016-02-29 10:09:56 -08:00
Jan Tattermusch
9f775a82cd Merge pull request #1286 from jskeet/idisposable
Implement IDisposable for CodedInputStream and CodedOutputStream
2016-02-29 09:27:06 -08:00
Jon Skeet
c0cf71bec9 Implement IDisposable for CodedInputStream and CodedOutputStream
This fixes issue #679 and issue #1282.
(The .gitignore change is just around ncrunch; I can put it in a separate PR if you really want.)
2016-02-29 11:51:56 +00:00
Jisi Liu
60a0d41a29 Merge pull request #1233 from davidzchen/python-path
Remove hack for building Python support with Bazel.
2016-02-25 13:02:55 -08:00
David Z. Chen
985c968443 Remove hack for building Python support with Bazel.
This change makes use of new imports attribute for Bazel's Python rules, which
enable adding directories to the PYTHONPATH. This allows us to remove
the hack for building protobuf's Python support with Bazel and now
allows projects to include protobuf using a Bazel external repository
rather than requiring it to be imported directly into the source tree as
//google/protobuf.

This change also updates the protobuf BUILD file to use a named
repository, @python//, for including Python headers rather than
//util/python. This allows projects to specify their own package for
Python headers when including protobuf with an external repository.

Fixes #1230
2016-02-25 12:52:21 -08:00
Jisi Liu
fb714b3606 Merge pull request #1275 from keveman/grpc_support
Fixed grpc C++ plugin support.
2016-02-25 12:34:27 -08:00
Manjunath Kudlur
f5c736352e Fixed grpc C++ plugin support.
grpc C++ plugin generates additional files, namely .grpc.pb.cc and
.grpc.pb.h. Adding these files to the outs of the _proto_gen rule, so
dependents don't complain about undeclared inclusions. Also, compiling
the .grpc.pb.cc requires additional header files from the grpc library,
so added //external:grpc_lib to the deps of the
cc_library. Clients are expected to declare that in their bazel
WORKSPACE, pointing it to @grpc//:grpc++{_unsecure}.
2016-02-25 08:50:50 -08:00
murgatroid99
c9f8a1b006 Moved CommonJS-specific files into commonjs directory 2016-02-24 14:23:08 -08:00
murgatroid99
a862b6b77f Fix CommonJS relative require generation, and test it 2016-02-24 13:44:57 -08:00
Joshua Haberman
cc775f7ac1 Merge pull request #1259 from silviulica/master
Add a modified patch from craigcitro@ to handle namespace sharing.
2016-02-24 10:50:03 -08:00
Jisi Liu
fc51bdc033 Merge pull request #1268 from keveman/grpc_support
Added grpc plugin support to cc_proto_library.
2016-02-23 10:53:45 -08:00
Pete Warden
cb39204af8 Updated library generation with iOS options 2016-02-23 10:18:32 -08:00
Manjunath Kudlur
f0966a746e Added grpc plugin support to cc_proto_library.
cc_proto_library now supports use_grpc_plugin flag that passes
--plugin=protoc-gen-grpc=grpc_cpp_plugin to protoc compiler
invocation. grpc_cpp_plugin is assumed to be present as
//external:grpc_cpp_plugin, so clients can setup their WORKSPACE files
appropriately to point to grpc location using bind.
2016-02-22 14:30:43 -08:00
Jan Tattermusch
8f67b165f0 Merge pull request #1267 from jskeet/vs2015
Require VS2015 in the solution file
2016-02-22 12:46:36 -08:00
Feng Xiao
513a8a69df Merge pull request #804 from bsilver8192/master
Add atomics support for 32-bit PPC.
2016-02-22 09:27:27 -08:00