JSONKit icon indicating copy to clipboard operation
JSONKit copied to clipboard

iOS 64 bit incompatibility

Open farski opened this issue 12 years ago • 17 comments
trafficstars

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.

farski avatar Sep 11 '13 13:09 farski

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( ,             )

postmechanical avatar Sep 17 '13 18:09 postmechanical

would replacing

  array->isa      = _JKArrayClass;

with

 object_setClass(array,  _JKArrayClass);

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

petermcd avatar Sep 21 '13 21:09 petermcd

Yes.

Bo98 avatar Sep 21 '13 21:09 Bo98

Cheers Bo98.

petermcd avatar Sep 21 '13 21:09 petermcd

pull request anyone?

WilliamDenniss avatar Nov 28 '13 14:11 WilliamDenniss

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

farski avatar Nov 28 '13 16:11 farski

@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! :)

WilliamDenniss avatar Nov 29 '13 02:11 WilliamDenniss

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.

farski avatar Nov 29 '13 02:11 farski

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.

WilliamDenniss avatar Nov 29 '13 02:11 WilliamDenniss

+1

ahanmal avatar Dec 20 '13 00:12 ahanmal

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

Looks like this fork is currently unmaintained? #129

WilliamDenniss avatar Feb 09 '14 06:02 WilliamDenniss

@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.

mz2 avatar Feb 09 '14 11:02 mz2

+1

PokerChang avatar Feb 25 '14 08:02 PokerChang

Anyone have the fix?

Xcode has me manually fixing each of the lines.

danoli3 avatar Apr 23 '14 04:04 danoli3

You may also have a look at #158.

jcbertin avatar Nov 13 '14 16:11 jcbertin

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.

9cat avatar Jan 16 '15 20:01 9cat

@9cat Is it still missing 64 bit support?

shobhitpuri avatar Apr 15 '15 16:04 shobhitpuri