aboutsummaryrefslogtreecommitdiff
path: root/objectivec/GPBCodedInputStream.m
diff options
context:
space:
mode:
authorThomas Van Lenten <thomasvl@google.com>2015-06-08 16:24:57 -0400
committerThomas Van Lenten <thomasvl@google.com>2015-06-08 17:17:22 -0400
commitd846b0b059b4d867536b98aa29475a387aa09114 (patch)
tree25ebf99cd0462281add17fc94bdf185e5fd9096c /objectivec/GPBCodedInputStream.m
parent3f9be70d067fb03cd03f99522473dee265b84ddb (diff)
downloadprotobuf-d846b0b059b4d867536b98aa29475a387aa09114.tar.gz
protobuf-d846b0b059b4d867536b98aa29475a387aa09114.tar.bz2
protobuf-d846b0b059b4d867536b98aa29475a387aa09114.zip
Beta quality drop of Objective C Support.
- Add more to the ObjC dir readme. - Merge the ExtensionField and ExtensionDescriptor to reduce overhead. - Fix an initialization race. - Clean up the Xcode schemes. - Remove the class/enum filter. - Remove some forced inline that were bloating things without proof of performance wins. - Rename some internal types to avoid conflicts with the well know types protos. - Drop the use of ApplyFunctions to the compiler/optimizer can do what it wants. - Better document some possible future improvements. - Add missing support for parsing repeated primitive fields in packed or unpacked forms. - Improve -hash. - Add *Count for repeated and map<> fields to avoid auto create when checking for them being set.
Diffstat (limited to 'objectivec/GPBCodedInputStream.m')
-rw-r--r--objectivec/GPBCodedInputStream.m26
1 files changed, 13 insertions, 13 deletions
diff --git a/objectivec/GPBCodedInputStream.m b/objectivec/GPBCodedInputStream.m
index 79d31fc7..71758baa 100644
--- a/objectivec/GPBCodedInputStream.m
+++ b/objectivec/GPBCodedInputStream.m
@@ -38,7 +38,7 @@
static const NSUInteger kDefaultRecursionLimit = 64;
-static inline void CheckSize(GPBCodedInputStreamState *state, size_t size) {
+static void CheckSize(GPBCodedInputStreamState *state, size_t size) {
size_t newSize = state->bufferPos + size;
if (newSize > state->bufferSize) {
[NSException raise:NSParseErrorException format:@""];
@@ -50,26 +50,26 @@ static inline void CheckSize(GPBCodedInputStreamState *state, size_t size) {
}
}
-static inline int8_t ReadRawByte(GPBCodedInputStreamState *state) {
+static int8_t ReadRawByte(GPBCodedInputStreamState *state) {
CheckSize(state, sizeof(int8_t));
return ((int8_t *)state->bytes)[state->bufferPos++];
}
-static inline int32_t ReadRawLittleEndian32(GPBCodedInputStreamState *state) {
+static int32_t ReadRawLittleEndian32(GPBCodedInputStreamState *state) {
CheckSize(state, sizeof(int32_t));
int32_t value = OSReadLittleInt32(state->bytes, state->bufferPos);
state->bufferPos += sizeof(int32_t);
return value;
}
-static inline int64_t ReadRawLittleEndian64(GPBCodedInputStreamState *state) {
+static int64_t ReadRawLittleEndian64(GPBCodedInputStreamState *state) {
CheckSize(state, sizeof(int64_t));
int64_t value = OSReadLittleInt64(state->bytes, state->bufferPos);
state->bufferPos += sizeof(int64_t);
return value;
}
-static inline int32_t ReadRawVarint32(GPBCodedInputStreamState *state) {
+static int32_t ReadRawVarint32(GPBCodedInputStreamState *state) {
int8_t tmp = ReadRawByte(state);
if (tmp >= 0) {
return tmp;
@@ -104,7 +104,7 @@ static inline int32_t ReadRawVarint32(GPBCodedInputStreamState *state) {
return result;
}
-static inline int64_t ReadRawVarint64(GPBCodedInputStreamState *state) {
+static int64_t ReadRawVarint64(GPBCodedInputStreamState *state) {
int32_t shift = 0;
int64_t result = 0;
while (shift < 64) {
@@ -119,7 +119,7 @@ static inline int64_t ReadRawVarint64(GPBCodedInputStreamState *state) {
return 0;
}
-static inline void SkipRawData(GPBCodedInputStreamState *state, size_t size) {
+static void SkipRawData(GPBCodedInputStreamState *state, size_t size) {
CheckSize(state, size);
state->bufferPos += size;
}
@@ -222,7 +222,7 @@ NSString *GPBCodedInputStreamReadRetainedString(
return result;
}
-NSData *GPBCodedInputStreamReadRetainedData(GPBCodedInputStreamState *state) {
+NSData *GPBCodedInputStreamReadRetainedBytes(GPBCodedInputStreamState *state) {
int32_t size = ReadRawVarint32(state);
if (size < 0) return nil;
CheckSize(state, size);
@@ -232,7 +232,7 @@ NSData *GPBCodedInputStreamReadRetainedData(GPBCodedInputStreamState *state) {
return result;
}
-NSData *GPBCodedInputStreamReadRetainedDataNoCopy(
+NSData *GPBCodedInputStreamReadRetainedBytesNoCopy(
GPBCodedInputStreamState *state) {
int32_t size = ReadRawVarint32(state);
if (size < 0) return nil;
@@ -453,8 +453,8 @@ void GPBCodedInputStreamCheckLastTagWas(GPBCodedInputStreamState *state,
GPBCodedInputStreamPopLimit(&state_, oldLimit);
}
-- (NSData *)readData {
- return [GPBCodedInputStreamReadRetainedData(&state_) autorelease];
+- (NSData *)readBytes {
+ return [GPBCodedInputStreamReadRetainedBytes(&state_) autorelease];
}
- (uint32_t)readUInt32 {
@@ -499,7 +499,7 @@ void GPBCodedInputStreamCheckLastTagWas(GPBCodedInputStreamState *state,
// Returns true if the passed in bytes are 7 bit ascii.
// This routine needs to be fast.
-static inline bool AreBytesIn7BitASCII(const uint8_t *bytes, NSUInteger len) {
+static bool AreBytesIn7BitASCII(const uint8_t *bytes, NSUInteger len) {
// In the loops below, it's more efficient to collect rather than do
// conditional at every step.
#if __LP64__
@@ -587,7 +587,7 @@ static inline bool AreBytesIn7BitASCII(const uint8_t *bytes, NSUInteger len) {
return true;
}
-static inline void GPBStringInitStringValue(GPBString *string) {
+static void GPBStringInitStringValue(GPBString *string) {
OSSpinLockLock(&string->lock_);
GPBStringInitStringValueAlreadyLocked(string);
OSSpinLockUnlock(&string->lock_);