Skip to content

Instantly share code, notes, and snippets.

View richardjrossiii's full-sized avatar

Richard Ross richardjrossiii

  • Facebook
  • Palo Alto, CA
View GitHub Profile
#include <stdatomic.h>
#include <stdint.h>
#include <stdbool.h>
/*!
An atomic ARC reference. Here's how it works:
The lowest bit of the pointer (mask 0x1) is used as a tag for the pointer being stored.
if the tag bit is set, that means that one thread currently owns this pointer, and will release it if the value has
been concurrently updated.
@richardjrossiii
richardjrossiii / gist:32389f163325efa00c37
Created September 2, 2015 01:07
NSString methods implemented
_swiftInitWithString_NSString:
queryToDict
firstCharacter
pinyinStringFromPinyinWithToneNumber
stringByStrippingDiacritics
strokeStringFromNumberString
simplifiedChineseCompare:
traditionalChineseZhuyinCompare:
stringByAddingPercentEncodingWithAllowedCharacters:
precomposedStringWithCanonicalMapping