<commit_before>#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import <Foundation/NSThread.h>

#include "../../platform/platform.hpp"

#include "../../base/logging.hpp"


/// Used to trick iOs and enable multithreading support with non-native pthreads.
@interface Dummy : NSObject 
- (void) dummyThread: (id) obj;
@end

@implementation Dummy
- (void) dummyThread: (id) obj {}
@end


/// Used to log NSExceptions.
static void exceptionHandler(NSException * ex)
{
  NSArray *stack = [ex callStackSymbols];
  NSLog(@"%@", ex.name);
  NSLog(@"%@", ex.reason);
  NSLog(@"Stack trace: %@", stack);
}

int main(int argc, char * argv[])
{
  LOG(LINFO, ("MapsWithMe started, detected CPU cores:", GetPlatform().CpuCores()));

  NSSetUncaughtExceptionHandler(&exceptionHandler);

  NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

  Dummy * dummy = [[Dummy alloc] autorelease];
  NSThread * thread = [[[NSThread alloc] initWithTarget:dummy selector:@selector(dummyThread:) object:nil] autorelease];
  [thread start];

  int retVal = UIApplicationMain(argc, argv, nil, nil);
  [pool release];
  return retVal;
}<commit_msg>[iOS] Now use autorelease block. Code will compile with LLVM 3.0, xCode version >= 4.2.<commit_after>#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import <Foundation/NSThread.h>

#include "../../platform/platform.hpp"

#include "../../base/logging.hpp"


/// Used to trick iOs and enable multithreading support with non-native pthreads.
@interface Dummy : NSObject 
- (void) dummyThread: (id) obj;
@end

@implementation Dummy
- (void) dummyThread: (id) obj {}
@end


/// Used to log NSExceptions.
static void exceptionHandler(NSException * ex)
{
  NSArray *stack = [ex callStackSymbols];
  NSLog(@"%@", ex.name);
  NSLog(@"%@", ex.reason);
  NSLog(@"Stack trace: %@", stack);
}

int main(int argc, char * argv[])
{
  LOG(LINFO, ("MapsWithMe started, detected CPU cores:", GetPlatform().CpuCores()));

  NSSetUncaughtExceptionHandler(&exceptionHandler);
  int retVal;
  @autoreleasepool
  {
    Dummy * dummy = [[Dummy alloc] autorelease];
    NSThread * thread = [[[NSThread alloc] initWithTarget:dummy selector:@selector(dummyThread:) object:nil] autorelease];
    [thread start];

    retVal = UIApplicationMain(argc, argv, nil, nil);
  }
  return retVal;
}
{'fraction_non_alphanumeric': 0.15814558058925476, 'fraction_numerical': 0.0017331022530329288, 'mean_word_length': 4.631707317073171, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 10, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '467449', 'n_tokens_mistral': 790, 'n_tokens_neox': 753, 'n_words': 204}