Eliminate END! datatype, convert to low-bit check #177
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.
This removes END! and REB_END as a datatype consideration. It
replaces the idea with a signal of whether a value header indicates an
end or not being a property of the low bit being set (on either big endian
or little endian systems).
Testing whether a value header is an end is just (header % 2 == 0).
This accelerates tests for ends, reclaims a type, and it also means that
an end can be overlaid on top of other non-value-header types...such
as the low bit of a pointer (typically 0 on most architectures because
pointers are never odd). Signifying a terminal can thus be done with
only 1/4 the total size of a REBVAL, and easily so.
The test for an END--which is performed rather frequently--becomes
very slightly faster. This is negated some by the fact that often what used
to be a single get-type-and-switch turns into a two step process of testing
for an end and then testing for the type. Overall it comes out only a little
bit ahead of even, but the real avantage comes from the features that this
will enable in future commits...