Repository navigation
Mark OASIS reader error branches as unlikely - #2512
Open
nikosavola wants to merge 1 commit into
Open
nikosavola wants to merge 1 commit into
nikosavola wants to merge 1 commit into
Conversation
- Add TL_IF_UNLIKELY to tlCpp.h: an if statement whose body is a cold path, [[unlikely]] where C++20 provides it, __builtin_expect on older gcc and clang - error() is virtual and not noreturn, so the compiler cannot tell the EOF and overflow checks in the varint and coordinate readers are cold
nikosavola
force-pushed
the
pr-oasis-hints
branch
from
October 15, 2026 07:29
eaa91c3 to
ed93026
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Marks the error branches in the OASIS varint and coordinate readers as cold paths.
TL_IF_UNLIKELYto tlCpp.h: anifstatement whose body is a cold path. It expands toif (cond) [[unlikely]]where the standard provides the attribute (C++20 and up, through__has_cpp_attribute), to__builtin_expecton gcc and clang below C++20, and to a plainifelsewhere.get_uint64,get_uint32, and the coordinate and delta readers.error()is virtual and not noreturn, so a compiler cannot tell these branches are cold from the call graph.