aboutsummaryrefslogtreecommitdiff
path: root/objectivec/GPBCodedInputStream_PackagePrivate.h
diff options
context:
space:
mode:
authorThomas Van Lenten <thomasvl@google.com>2015-12-17 14:35:44 -0500
committerThomas Van Lenten <thomasvl@google.com>2015-12-17 16:05:50 -0500
commitd6590d653415c0bfacf97e7f768dd3c994cb8d26 (patch)
tree8c0f6f98eb867d520e95d30d32a6d0e4fe55906c /objectivec/GPBCodedInputStream_PackagePrivate.h
parentafbc89a263d57bb2e36ce5f07b979c739bb2e8cd (diff)
downloadprotobuf-d6590d653415c0bfacf97e7f768dd3c994cb8d26.tar.gz
protobuf-d6590d653415c0bfacf97e7f768dd3c994cb8d26.tar.bz2
protobuf-d6590d653415c0bfacf97e7f768dd3c994cb8d26.zip
Drop all use of OSSpinLock
Apple engineers have pointed out that OSSpinLocks are vulnerable to live locking on iOS in cases of priority inversion: . http://mjtsai.com/blog/2015/12/16/osspinlock-is-unsafe/ . https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20151214/000372.html - Use a dispatch_semaphore_t within the extension registry. - Use a dispatch_semaphore_t for protecting autocreation within messages. - Drop the custom/internal GPBString class since we don't have really good numbers to judge the locking replacements and it isn't required. We can always bring it back with real data in the future.
Diffstat (limited to 'objectivec/GPBCodedInputStream_PackagePrivate.h')
-rw-r--r--objectivec/GPBCodedInputStream_PackagePrivate.h17
1 files changed, 0 insertions, 17 deletions
diff --git a/objectivec/GPBCodedInputStream_PackagePrivate.h b/objectivec/GPBCodedInputStream_PackagePrivate.h
index e482b4c9..90bd0c92 100644
--- a/objectivec/GPBCodedInputStream_PackagePrivate.h
+++ b/objectivec/GPBCodedInputStream_PackagePrivate.h
@@ -39,19 +39,6 @@
@class GPBUnknownFieldSet;
@class GPBFieldDescriptor;
-// GPBString is a string subclass that avoids the overhead of initializing
-// a full NSString until it is actually needed. Lots of protocol buffers contain
-// strings, and instantiating all of those strings and having them parsed to
-// verify correctness when the message was being read was expensive, when many
-// of the strings were never being used.
-//
-// Note for future-self. I tried implementing this using a NSProxy.
-// Turned out the performance was horrible in client apps because folks
-// like to use libraries like SBJSON that grab characters one at a time.
-// The proxy overhead was a killer.
-@interface GPBString : NSString
-@end
-
typedef struct GPBCodedInputStreamState {
const uint8_t *bytes;
size_t bufferSize;
@@ -92,10 +79,6 @@ typedef struct GPBCodedInputStreamState {
CF_EXTERN_C_BEGIN
-// Returns a GPBString with a +1 retain count.
-GPBString *GPBCreateGPBStringWithUTF8(const void *bytes, NSUInteger length)
- __attribute__((ns_returns_retained));
-
int32_t GPBCodedInputStreamReadTag(GPBCodedInputStreamState *state);
double GPBCodedInputStreamReadDouble(GPBCodedInputStreamState *state);