#include <Foundation/NSString.h>
#include <gperftools/heap-profiler.h>

//Class MLTestClass;

@interface MLTestClass: NSObject {
@public
}
- (id)init;
- (void)someF;
@end

@implementation MLTestClass
- (id)init
{
        return [super init];
}

- (void)someF
{
}

@end

int main()
{
        static char static_char;
        MLTestClass * tc;
        HeapProfilerStart("/tmp/test-prof");
        int i = 0;
        for (; i < 100000; ++i)
        {
                tc =  [[MLTestClass alloc] init];
//                [tc someF];
                objc_setAssociatedObject(tc, &static_char, nil, OBJC_ASSOCIATION_ASSIGN);
//                [tc someF];
//                objc_setAssociatedObject(tc, &static_char, tc, OBJC_ASSOCIATION_ASSIGN);
//                [tc someF];
//                objc_getAssociatedObject(tc, &static_char);
                [tc finalize];
                [tc release];
        }
        HeapProfilerDump("by-req");
        HeapProfilerStop();
}
