Commit Graph

22 Commits

Author SHA1 Message Date
Josh Haberman
d61aede89c Down-integrate from google3. 2018-09-04 10:58:54 -07:00
Jisi Liu
09354db143 Merge from Google internal for 3.4 release 2017-07-18 15:38:30 -07:00
Feng Xiao
d36c0c538a Down-integrate from google3. 2017-03-29 14:33:05 -07:00
Paul Yang
6b27c1f981 Add file option php_class_prefix (#2849)
This option will be prepended to generated classes of all messages in
the containing file.
2017-03-17 11:08:06 -07:00
Khing
f9fc56c42a Fix #2071 replacing /bin/sh with bash
On Ubuntu /bin/sh is dash by default, this can cause
generate_descriptor_proto.sh fail to execute.
2016-09-07 14:46:50 +10:00
Jisi Liu
0de06f54bc Merge branch 'master' of github.com:google/protobuf 2016-03-30 11:43:44 -07:00
Jisi Liu
3b3c8abb96 Integrate google internal changes. 2016-03-30 11:39:59 -07: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
Jon Skeet
957e877d52 Generate C# code whenever descriptor.proto changes
This is a start to fixing issue #1212. It won't help for test protos,
conformance etc, but it will definitely be better than nothing, and
would have highlighted a change in descriptor.proto which broken C#
earlier.
2016-02-15 10:33:13 +00:00
Jisi Liu
5221dcbe47 Integrate from google internal.
Java files are moved to un-do the hack in the prevous commit, which
moved the java files to the original position for integration.
2016-01-29 13:51:05 -08:00
Jisi Liu
ef50a2976e Update objc script in generate_descriptor_proto.sh 2015-09-08 13:21:45 -07:00
TeBoring
7366efd81e Add packFrom, unpackTo and is in google.protobuf.Any.
The previous two methods make it easy to transform between any and normal message.
unPackeTo will throw error if the type url in any doesn't match the type of the message to be transformed to.
is checks any's type url matches the give GPBMessage type.
2015-07-21 15:45:02 -07:00
Bo Yang
5db217305f down-integrate internal changes 2015-05-21 19:32:02 -07:00
Feng Xiao
33c92803d5 Include generated code of well-known types in protobuf C++ runtime.
Change-Id: I23dee1c1d27b6440658680e9c273b6250213123c
2015-05-11 13:47:41 -07:00
Bo Yang
efa666cf0a Generate pbconfig.h in generate_descriptor_proto.sh 2015-04-30 10:29:47 -07:00
Jisi Liu
0b3cfc7981 Remove the extra -j8 as it can be passed in $@ already.
Change-Id: I97960f30d50b1635aa6c395377cd021ef5ebddd5
2015-03-02 10:54:10 -08:00
Jisi Liu
885b612f74 Down integrate from Google internal branch for C++ and Java.
- Maps for C++ lite
- C++ Arena optimizations.
- Java Lite runtime code size optimization.

Change-Id: I7537a4357c1cb385d23f9e8aa7ffdfeefe079f13
2015-02-28 17:06:49 -08:00
kenton@google.com
fccb146e3f Massive roll-up of changes. See CHANGES.txt. 2009-12-18 02:11:36 +00:00
kenton@google.com
80b1d62bfc Submit recent changes from internal branch, including "lite mode" for
C++ and Java.  See CHANGES.txt for more details.
2009-07-29 01:13:20 +00:00
kenton@google.com
2f669cbe75 * Avoid using pushd/popd in generate_descriptor_proto.sh because they are
bash-only features, and /bin/sh is not a symlink to bash on all systems.
* If an input file is a Windows absolute path (e.g. "C:\foo\bar.proto") and
  the import path only contains "." (or contains "." but does not contain
  the file), protoc incorrectly thought that the file was under ".", because
  it thought that the path was relative (since it didn't start with a slash).
  This has been fixed.
2008-12-02 05:59:15 +00:00
temporal
779f61c6a3 Integrate recent changes from google3.
protoc
- New flags --encode and --decode can be used to convert between protobuf text
  format and binary format from the command-line.
- New flag --descriptor_set_out can be used to write FileDescriptorProtos for
  all parsed files directly into a single output file.  This is particularly
  useful if you wish to parse .proto files from programs written in languages
  other than C++: just run protoc as a background process and have it output
  a FileDescriptorList, then parse that natively.

C++
- Reflection objects are now per-class rather than per-instance.  To make this
  possible, the Reflection interface had to be changed such that all methods
  take the Message instance as a parameter.  This change improves performance
  significantly in memory-bandwidth-limited use cases, since it makes the
  message objects smaller.  Note that source-incompatible interface changes
  like this will not be made again after the library leaves beta.

Python
- MergeFrom(message) and CopyFrom(message) are now implemented.
- SerializeToString() raises an exception if the message is missing required
  fields.
- Code organization improvements.
- Fixed doc comments for RpcController and RpcChannel, which had somehow been
  swapped.
2008-08-13 03:15:00 +00:00
temporal
40ee551715 Initial checkin. 2008-07-10 02:12:20 +00:00