Latest 1.3.1
Homepage https://github.com/pavelosipov/POSAllocationTracker
License MIT
Platforms ios 7.0, osx 10.8, requires ARC
Authors

POSAllocationTracker

Version

POSAllocationTracker is a simple utility for runtime tracking class’ instances.
Tracker automatically watches for all classes which are using directly or indirectly init method
of NSObject during initialization. Tracking is enable in DEBUG builds only, so it doesn’t not affect
performance of release builds. The idea of the library was born during reading Facebook’s article
Reducing FOOMs in the Facebook iOS app.
Library is extremelly simple to use. There is only one class with a single method in it:

[POSAllocationTracker instanceCountForClass:Dummy.class]

Here is a complete demo from unit tests of the library:

@interface Dummy : NSObject
@end

@implementation Dummy
@end

@interface POSAllocationTrackerTests : XCTestCase

@end

@implementation POSAllocationTrackerTests

- (void)testInstanceCounterCorrectness {
    XCTAssert([POSAllocationTracker instanceCountForClass:Dummy.class] == 0);
    @autoreleasepool {
        __unused Dummy *dummy = [Dummy new];
        XCTAssert([POSAllocationTracker instanceCountForClass:Dummy.class] == 1);
    }
    XCTAssert([POSAllocationTracker instanceCountForClass:Dummy.class] == 0);
}

@end

Latest podspec

{
    "name": "POSAllocationTracker",
    "version": "1.3.1",
    "license": "MIT",
    "summary": "Simple utility for runtime tracking instances of interested classes.",
    "homepage": "https://github.com/pavelosipov/POSAllocationTracker",
    "authors": {
        "Pavel Osipov": "[email protected]"
    },
    "source": {
        "git": "https://github.com/pavelosipov/POSAllocationTracker.git",
        "tag": "1.3.1"
    },
    "platforms": {
        "ios": "7.0",
        "osx": "10.8"
    },
    "requires_arc": true,
    "xcconfig": {
        "CLANG_CXX_LANGUAGE_STANDARD": "gnu++14",
        "OTHER_LDFLAGS": "-lc++"
    },
    "source_files": "POSAllocationTracker/**/*.{h,m,mm,cpp}",
    "private_header_files": "POSAllocationTracker/AllocationTracker.h"
}

Pin It on Pinterest

Share This