aboutsummaryrefslogtreecommitdiff
path: root/objectivec/GPBRootObject.m
diff options
context:
space:
mode:
authorPaul Yang <TeBoring@users.noreply.github.com>2015-06-19 15:58:31 -0700
committerPaul Yang <TeBoring@users.noreply.github.com>2015-06-19 15:58:31 -0700
commitd3d66d79760f7f233c404c10528fca22f99843b2 (patch)
tree8a0c97de2bf3c1ea686213c9384ef72d5528e3a1 /objectivec/GPBRootObject.m
parent5b3a8e76356ef2dcb4a87c3fa7323bdec01cf7ce (diff)
parent8c88957ef375f3b739b6e72ea5c2fb71b12e1fc2 (diff)
downloadprotobuf-d3d66d79760f7f233c404c10528fca22f99843b2.tar.gz
protobuf-d3d66d79760f7f233c404c10528fca22f99843b2.tar.bz2
protobuf-d3d66d79760f7f233c404c10528fca22f99843b2.zip
Merge pull request #503 from thomasvl/add_nonnill_markup
Add nonnull/nullable/null_resettable markup to ObjC library.
Diffstat (limited to 'objectivec/GPBRootObject.m')
-rw-r--r--objectivec/GPBRootObject.m5
1 files changed, 4 insertions, 1 deletions
diff --git a/objectivec/GPBRootObject.m b/objectivec/GPBRootObject.m
index 3f648257..7036723f 100644
--- a/objectivec/GPBRootObject.m
+++ b/objectivec/GPBRootObject.m
@@ -36,6 +36,7 @@
#import <CoreFoundation/CoreFoundation.h>
#import "GPBDescriptor.h"
+#import "GPBExtensionRegistry.h"
#import "GPBUtilities_PackagePrivate.h"
@interface GPBExtensionDescriptor (GPBRootObject)
@@ -97,6 +98,7 @@ static CFHashCode GPBRootExtensionKeyHash(const void *value) {
static OSSpinLock gExtensionSingletonDictionaryLock_ = OS_SPINLOCK_INIT;
static CFMutableDictionaryRef gExtensionSingletonDictionary = NULL;
+static GPBExtensionRegistry *gDefaultExtensionRegistry = NULL;
+ (void)initialize {
// Ensure the global is started up.
@@ -113,6 +115,7 @@ static CFMutableDictionaryRef gExtensionSingletonDictionary = NULL;
gExtensionSingletonDictionary =
CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &keyCallBacks,
&kCFTypeDictionaryValueCallBacks);
+ gDefaultExtensionRegistry = [[GPBExtensionRegistry alloc] init];
}
if ([self superclass] == [GPBRootObject class]) {
@@ -126,7 +129,7 @@ static CFMutableDictionaryRef gExtensionSingletonDictionary = NULL;
+ (GPBExtensionRegistry *)extensionRegistry {
// Is overridden in all the subclasses that provide extensions to provide the
// per class one.
- return nil;
+ return gDefaultExtensionRegistry;
}
+ (void)globallyRegisterExtension:(GPBExtensionDescriptor *)field {