Fixed Android 11 incompatibility with ValueSlot ptr tagging #104
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The prior size optimization in ValueSlot used the high byte of the
_pointer
field to distinguish between an actual pointer and aninline 7-bit Value; it assumed if the upper byte is zero then it's a
pointer.
This isn't true anymore in Android: "Starting in Android 11, for 64-
bit processes, all heap allocations have an implementation defined tag
set in the top byte of the pointer on devices with kernel support for
ARM Top-byte Ignore (TBI)."
Switched to using the low byte as a tag, with a value of 0xFF
denoting inline, and anything else being a pointer. This works because
any Value* we store there must have at least one zero bit in the
LSB; see the comment in ValueSlot.hh for details.