This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
uint8_t get_EC_curve(const EC_key_t ec) | |
{ | |
int nid; | |
nid = EC_GROUP_get_curve_name(EC_KEY_get0_group(ec)); | |
return get_ec_curve_type(nid); | |
} | |
static EC_KEY *SecKeyToOpenSSLKey(SecKeyRef secKey, int public) { | |
CFErrorRef error; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main(int argc, const char * argv[]) { | |
@autoreleasepool { | |
NSString *dst = | |
[NSHomeDirectory() stringByAppendingPathComponent:@"Desktop/file.aar"]; | |
AAByteStream fileStream = AAFileStreamOpenWithPath(dst.UTF8String, | |
O_CREAT | O_WRONLY, 0644); | |
AAByteStream compressionStream = AACompressionOutputStreamOpen(fileStream, | |
AA_COMPRESSION_ALGORITHM_LZFSE, 1<<20, AA_FLAG_VERBOSITY_3, 0); | |
AAArchiveStream encodeStream = AAEncodeArchiveOutputStreamOpen(compressionStream, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
@interface AppDelegate : UIResponder <UIApplicationDelegate> | |
@end | |
__attribute__((noinline)) double GPBCodedInputStreamReadDouble(uint8_t *buf) { | |
int64_t value = OSReadLittleInt64(buf, 0); | |
double result; | |
memcpy(&result, &value, sizeof(result)); | |
return result; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" ?> | |
<package> | |
<id>com.google.ImageMapper</id> | |
<title>ImageMapper</title> | |
<owner> | |
<name>Dave MacLachlan</name> | |
</owner> | |
<import-schema>kdebug-strings</import-schema> | |
<ktrace-interval-schema> | |
<id>com-google-dyld-map-image-schema</id> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
total time: 635.49 milliseconds (100.0%) | |
total images loaded: 457 (451 from dyld shared cache) | |
total segments mapped: 15, into 3756 pages with 408 pages pre-fetched | |
total images loading time: 376.31 milliseconds (59.2%) | |
total load time in ObjC: 64.57 milliseconds (10.1%) | |
total debugger pause time: 0.00 milliseconds (0.0%) | |
total dtrace DOF registration time: 0.11 milliseconds (0.0%) | |
total rebase fixups: 1,164,368 | |
total rebase fixups time: 76.51 milliseconds (12.0%) | |
total binding fixups: 83,028 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/sysctl.h> | |
struct timeval AppLaunchTimeRelativeTo1970(void) { | |
id_t pid = getpid(); | |
int mib[] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, (int)pid }; | |
const size_t mibSize = sizeof(mib) / sizeof(mib[0]); | |
size_t infoSize = 0; | |
// Get initial size of KERN_PROC data structure. | |
if (sysctl(mib, mibSize, NULL, &infoSize, NULL, 0) != 0) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
code | meaning | |
---|---|---|
R | read-only | |
C | by-copy | |
& | by-reference | |
D | dynamic | |
G | getter (followed by selector name) | |
S | setter (followed by selector name) | |
V | instance variable (followed by variable name) | |
T | type encoding (followed by old-style type encoding) | |
W | weak |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Wraps C++ classes (ptrs and refs) so that they can be passed around in | |
* Objective-C++ programs without generating a lot of useless Objective-C | |
* runtime metadata. | |
* Use objc_metadata_hider_ptr for ptrs and objc_metadata_hider_ref for refs. | |
* Example use: | |
* ``` | |
* class Foo { | |
* public: | |
* .... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
#include <map> | |
#include <string> | |
struct CppType { | |
std::map<std::string, std::string> myMap; | |
}; | |
@interface ObjCType : NSObject { | |
CppType map; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
#import <objc/runtime.h> | |
int main(int argc, const char * argv[]) { | |
@autoreleasepool { | |
Class myClass = objc_allocateClassPair([NSObject class], "MyClass", 0); | |
IMP methodIMP = imp_implementationWithBlock(^(id self) { | |
return @"Hello"; | |
}); | |
if (!class_addMethod(myClass, @selector(description), methodIMP, "@@:")) { |
NewerOlder