JSONKit icon indicating copy to clipboard operation
JSONKit copied to clipboard

Fixes for modern targets.

Open jcbertin opened this issue 9 years ago • 4 comments

Once and for all, JSONKit crash on modern iOS/OSX because it doesn't handle tagged pointers correctly. Thus, when the code try to access ISA pointer directly by dereferencing the object without checking for tagged pointers, it will crash. Period. This patch handle tagged pointers on both platforms and add 64bit compatibility. I use it on machines running 24 hours a day for years now on system as old as iOS 4 and OS X 10.6. Without a crash, end of story.

jcbertin avatar Nov 13 '14 15:11 jcbertin

What about a merge?

crudolf avatar Dec 19 '14 11:12 crudolf

How much slower is this now over NSJSONSerializer?

odyth avatar Jan 14 '15 18:01 odyth

return(((uintptr_t)objectPtr) >> 60); will not work well on iOS14. The tag number now moves to the bottom three bits.

As apple suggested, we should use public API not to rely on these internal details.

https://developer.apple.com/videos/play/wwdc2020/10163/ Advancements in the Objective-C runtime

thorfei avatar Jun 29 '20 14:06 thorfei

Added JSONKitTest for benchmarking this PR.

jcbertin avatar Nov 23 '20 02:11 jcbertin