github/Mantle — pull request #111 by steipete (2013-07-21 19:08:15+00:00)
Title: Remove libextobjc usage.

libextobjc is used in some places within Mantle, but in all but one, doing things the low-level way is actually shorter. We also save some memory allocations since there's no more mtl_propertyAttributes. Functionality-wise this is the same and all tests still run.

This should be a no-brainer to merge, and I know several people who like Mantle but were turned off by the dependencies it needs. (https://twitter.com/nicklockwood/statuses/357074815267516416)

I've stripped out libextobjc once before for an older branch of Mantle in PSPDFKit, and now as I'm in the process or upgrading to latest I'd love to see this merged so I don't have to do this a third time.

The only possible argument for libextobjc is that Mantle code is nicer to read. However any developer who hasn't used libextobjc before will take more time to investigate @onExit than with the straightforward way of cleaning up stuff. I agree that mtl_propertyAttributes is nicer to work with than directly looking up the property attribute string, but with removing that we can automatically get rid of cleanup-code (no more malloc) and `BOOL isWeakProperty = strstr(attributes, ",W") != NULL;` is more verbose but equally understandable as `attributes->weak`.