Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS 64 bit incompatibility #135

Open
farski opened this issue Sep 11, 2013 · 17 comments
Open

iOS 64 bit incompatibility #135

farski opened this issue Sep 11, 2013 · 17 comments

Comments

@farski
Copy link

farski commented Sep 11, 2013

Unless I'm mistaken, JSONKit will not be able to compile when building iOS apps for 64 bit architectures, because the previously deprecated isa assignments are now completely removed.

@postmechanical
Copy link

You're not mistaken.

JSONKit.m:680:5: error: assignment to Objective-C's isa is deprecated in favor of object_setClass() [-Werror,-Wdeprecated-objc-isa-usage]
    array->isa      = _JKArrayClass;
    ^    ~~~~~~~~~~~~
    object_setClass( ,             )

@petermcd
Copy link

would replacing

  array->isa      = _JKArrayClass;

with

 object_setClass(array,  _JKArrayClass);

resolve the issue and work (as well of course doing the dictionary issue)?

@Bo98
Copy link

Bo98 commented Sep 21, 2013

Yes.

@petermcd
Copy link

Cheers Bo98.

@WilliamDenniss
Copy link

pull request anyone?

@farski
Copy link
Author

farski commented Nov 28, 2013

I believe the use of ISA assignment is done for speed reasons in this fork, and that's unlikely to change.

@WilliamDenniss
Copy link

@farski but it's for speed reasons people are enabling 64-bit slices. I doubt keeping these few lines of purportedly 32-bit optimised code is worth the trade-off of disabling the 64-bit slice in its entirety! :)

@farski
Copy link
Author

farski commented Nov 29, 2013

There are lots of forks out there that have made the change, but as far as this one, I think @johnezang has said it's not going to change. Perhaps that has changed since it became a bigger issue with 64-bit, though.

@WilliamDenniss
Copy link

Is it worth having an official 64bit optimised branch then? I can see a lot of people wanting this to get all the performance they can out of the 5S and iPad Air.

@ahanmal
Copy link

ahanmal commented Dec 20, 2013

+1

@WilliamDenniss
Copy link

I've switched my upstream repo to @mz2's master (incorporating #120) which addresses this issue.

Looks like this fork is currently unmaintained? #129

@mz2
Copy link

mz2 commented Feb 9, 2014

@farski the reason the isa pointer should not be assigned to directly any longer is actually performance: in the 64-bit runtime the isa pointer field holds the isa pointer... and "other runtime information" according to Apple's documentation. To be precise, 19 bits of the isa field go to holding the object's reference count inline which greatly speeds up reference counting in the common case where it fits in 19 bits (so by assigning to that field directly you could be messing with the object's retain count stored in those 19 bits of that address prior to your ->isa assignment). It would be trivial to make a preprocessor conditional to support both... but I doubt there'd be performance benefits really, presumably object_setClass is implemented as much more than an isa field assignment in the old runtime if that is what it does, and that should be inlining friendly. If you're worried of such an effect, showing it with a benchmark should be straightforward.

jad added a commit to jad/StreamHub-iOS-SDK that referenced this issue Feb 23, 2014
As documented here johnezang/JSONKit#135, JSONKit can't be compiled for 64 bit architectures. Replacing JSONKit with NSJSONSerialization resolves this issue for the Livefyre SDK.
@PokerChang
Copy link

+1

@danoli3
Copy link

danoli3 commented Apr 23, 2014

Anyone have the fix?

Xcode has me manually fixing each of the lines.

@jcbertin
Copy link

You may also have a look at #158.

@9cat
Copy link

9cat commented Jan 16, 2015

Missing 64-bit support - Beginning on February 1, 2015 new iOS apps submitted to the App Store must include 64-bit support and be built with the iOS 8 SDK. Beginning June 1, 2015 app updates will also need to follow the same requirements. To enable 64-bit in your project, we recommend using the default Xcode build setting of “Standard architectures” to build a single binary with both 32-bit and 64-bit code.

@shobhitpuri
Copy link

@9cat Is it still missing 64 bit support?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests