Use memcmp() instead of strncmp() to compare cache buckets.

In the rare case when a hash collision occurs between two values, the
object cache's bucket-probing code needs to go as far as comparing the
bytes content of the candidate bucket with the bytes content of the
current token.

For numeric values, 'bytes' refers to the raw bytes of the number.
These byte representations may contain leading '\0' values.  strncmp()
is only designed for comparing strings, so characters appearing after
a '\0' are not compared.

Therefore, if a hash collision occurs between two numeric values that
only differ in their lower bytes, they will be assigned to the same
bucket, and the cache will return the first token's object for the
second token's value.

memcmp() is binary-safe and considers all of the numbers' bytes,
avoiding this problem.

This is a rare case indeed, but here is an example that reproduces the
problem:

    JSON Input:             [ 1734.75, 417.75 ]
    Identical Types:        double (8 bytes)
    Identical DJB Hashes:   2510392872

    JSONKit (strncmp):      [ 1734.75, 1734.75 ]    (boo!)
    JSONKit (memcmp):       [ 1734.75, 417.75 ]     (yay!)
Fix ambiguous method (initWithObjects:count:) compilation errors under Clang 3.0.
Merge pull request #50 from atnan/fixclang2errors

Fix compilation errors under Clang 3.0
Merge pull request #46 from jparise/cache-collisions

Use memcmp() instead of strncmp() to compare cache buckets.
Fixes issues #9, #15, #40, aka "crashes on 64-bit Lion / 10.7 ABI".

This commit implements a work around for a bug in 10.7 that was caused by
a 10.7 64-bit ABI breaking change.

Technically, this is not a bug in JSONKit, but with Mac OS X.

When making changes to the ABI, it is (at least de facto) required to bump
the "major version" of a shared library so that code designed around and
built against the "guarantees" provided by previous versions ABI / API
are not violated.

Not only was this not done in 10.7, the ABI breaking change isn't even
officially documented (to the best of my knowledge).  It's certainly not
mentioned in the 10.7 release notes.
Surpress "multiple methods named" error
I realize that `collection` won't always be an NSArray, but the cast will let the compiler know to expect a NSUInteger return type instead of `size_t` which is also a return type a method named `count` inside of JSONKit.
Changed cast to NSDictionary per John's request
Merge pull request #58 from samsoffes/master

Surpress "multiple methods named" error
Updated README.md with benchmark information for NSJSONSerialization.
Merge branch 'master' of github.com:johnezang/JSONKit
Minor changes to hashing and cache aging algorithms.

Hashing was changed slightly to exploit the fact that a significant amount of real world JSON strings / keys will have a high percentage of ASCII characters.

Cache aging was modified to use an AIMD (additive increase, multiplicative decrease) policy.  When an item is found in the cache, its age is incremented by one using saturating arithmetic.  Ages are "quasi-randomly" aged using unsigned right shifts, or in other words its age is divided in half. Since ages decrease far more quickly than they increase, the cache can quickly adapt and converge on the "hot set".
Merge remote-tracking branch 'upstream/stable'

Conflicts:
	JSONKit.m