This file contains 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
******************** O2 ******************** | |
$ clang++ -DDUMB_KEY -Wall -stdlib=libstdc++ -std=c++11 -O2 keybench.cpp && ./a.out | |
sizeof(Key) = 16 | |
5 iterations: | |
elapsed: 17635698 nsec | |
elapsed: 16047390 nsec | |
elapsed: 15367448 nsec | |
elapsed: 15024112 nsec |
This file contains 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 <CoreFoundation/CoreFoundation.h> | |
#include <objc/runtime.h> | |
typedef struct __CFRuntimeClass { | |
CFIndex version; | |
const char *className; | |
void (*init)(CFTypeRef cf); | |
CFTypeRef (*copy)(CFAllocatorRef allocator, CFTypeRef cf); | |
void (*finalize)(CFTypeRef cf); | |
Boolean (*equal)(CFTypeRef cf1, CFTypeRef cf2); |
This file contains 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 <CoreFoundation/CoreFoundation.h> | |
#import <CoreGraphics/CoreGraphics.h> | |
#import <QuartzCore/QuartzCore.h> | |
#import <UIKit/UIKit.h> | |
#import <objc/runtime.h> | |
///////////////////////////////////////////////////////////////////// | |
@interface ApplicationDelegate: NSObject<UIApplicationDelegate> { |
This file contains 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 <UIKit/UIKit.h> | |
/* | |
* ApplicationDelegate | |
*/ | |
@interface ApplicationDelegate: NSObject<UIApplicationDelegate> { | |
UIWindow* m_window; | |
} |
This file contains 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
/* There is no native way to get IMEI, so we have to call | |
* Java classes through JNI. | |
* | |
* But fear not: JNIpp (github.com/DmitrySkiba/itoa-jnipp) makes | |
* this task much easier. | |
* | |
* To get IMEI we need to perform the following calls: | |
* | |
* TelephonyManager telephony=(TelephonyManager) | |
* context.getSystemService(Context.TELEPHONY_SERVICE); |