diff options
author | Thomas Van Lenten <thomasvl@google.com> | 2016-09-01 11:45:50 -0400 |
---|---|---|
committer | Thomas Van Lenten <thomasvl@google.com> | 2016-09-01 18:08:59 -0400 |
commit | 13a41246dd9aa6c6a84d436307b933fd4a6ec4a8 (patch) | |
tree | b3874be6ed13a5d22655c55c0a2e4f80fdb99f35 /objectivec/google/protobuf/Type.pbobjc.m | |
parent | c0a6a6b4628a634f6a0529c9f7e9e1e0fe66d4d6 (diff) | |
download | protobuf-13a41246dd9aa6c6a84d436307b933fd4a6ec4a8.tar.gz protobuf-13a41246dd9aa6c6a84d436307b933fd4a6ec4a8.tar.bz2 protobuf-13a41246dd9aa6c6a84d436307b933fd4a6ec4a8.zip |
Make Root's +extensionRegistry generation smarter.
At generation time, walk the file's dependencies to see what really contains
extensions so we can generate more minimal code that only links together the
roots that provided extensions. Gets a bunch of otherwise noop code out of
the call flow when the roots are +initialized.
Diffstat (limited to 'objectivec/google/protobuf/Type.pbobjc.m')
-rw-r--r-- | objectivec/google/protobuf/Type.pbobjc.m | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/objectivec/google/protobuf/Type.pbobjc.m b/objectivec/google/protobuf/Type.pbobjc.m index 6c7b4efd..b48f4d0f 100644 --- a/objectivec/google/protobuf/Type.pbobjc.m +++ b/objectivec/google/protobuf/Type.pbobjc.m @@ -31,18 +31,8 @@ @implementation GPBTypeRoot -+ (GPBExtensionRegistry*)extensionRegistry { - // This is called by +initialize so there is no need to worry - // about thread safety and initialization of registry. - static GPBExtensionRegistry* registry = nil; - if (!registry) { - GPBDebugCheckRuntimeVersion(); - registry = [[GPBExtensionRegistry alloc] init]; - [registry addExtensions:[GPBAnyRoot extensionRegistry]]; - [registry addExtensions:[GPBSourceContextRoot extensionRegistry]]; - } - return registry; -} +// No extensions in the file and none of the imports (direct or indirect) +// defined extensions, so no need to generate +extensionRegistry. @end |