first take on static dispatch mapping. #238
Closed
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.
call to one of the dispatched functions, we determine the correct target and replace a static func ptr to point to the correct target. on subsequent calls
we directly call the target. It's a bit messy and
while it eliminates the branching and ifunc indirection at runtime, it still involves a second function call and copying of a stack frame etc. The macros are
a fair bit uglier now but one needs to be able to
specify both the full arg list of a given function, as well as specify only the names of the args, to
macro out the invocation of the passthrough call.
The extra router function could be merged into the resolve function, but i wanted to leave that more
or less untouched for the first review.