-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Manually manage inlining/noinlining of _checkbounds/BoundsError
this should help avoiding unnecessary tuple allocations, i.e. delaying allocation until an error actually occurs
- Loading branch information
1 parent
14ea3b6
commit 359d5d3
Showing
2 changed files
with
11 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
359d5d3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this actually work? I would not expect this to generate the same AST as actually splicing in an Expr(:meta)
359d5d3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not expect this to work. This code creates a meta Expr at run time, when
_checkbounds
is called, and then throws it away.In abstractarray.jl,
@inline
should work. Did it not?We could add a
@meta
macro for writing meta exprs into ASTs. However the compiler might currently be too sensitive to the placement of meta exprs for this to work well.359d5d3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it doesn't :|
Sorry for the noise.
However I'm not sure how to fix it. This kind of thing works in the REPL:
But when I try to use it in base.jl it segfaults during make.
No it doesn't:
359d5d3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that makes sense: the array operations used to implement
@inline
have not actually been defined yet.