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

Fixes for modern targets. #158

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Fixes for modern targets. #158

wants to merge 11 commits into from

Conversation

jcbertin
Copy link

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.

@crudolf
Copy link

crudolf commented Dec 19, 2014

What about a merge?

@odyth
Copy link

odyth commented Jan 14, 2015

How much slower is this now over NSJSONSerializer?

jcbertin referenced this pull request Oct 11, 2015
…rning.

The current (at the time of this writing) version of the `clang` static analyzer is complaing that the `objects` pointer is `NULL`.  This is a false positive warning from the analyzer.
@thorfei
Copy link

thorfei commented Jun 29, 2020

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

@jcbertin
Copy link
Author

Added JSONKitTest for benchmarking this PR.

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

Successfully merging this pull request may close these issues.

4 participants