Skip to content

Commit

Permalink
Merge pull request #128 from JuliaLang/precompile
Browse files Browse the repository at this point in the history
0.4 precompilation functions
  • Loading branch information
stevengj committed Aug 8, 2015
2 parents 5cfb06a + 6644ba5 commit e324d63
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ Currently, the `@compat` macro supports the following syntaxes:

* `Timer(timeout::Real, repeat::Real=0.0)` and `Timer(cb::Function, timeout::Real, repeat::Real=0.0)` allow julia 0.4-style Timers to be constructed and used.

* `__precompile(iscompiled::Bool)__` and `include_dependency(path::AbstractString)` allow
Julia 0.4 precompilation information to be provided (with no effect in earlier versions).
(However, to enable precompiling in 0.4, it is better to explicitly put `VERSION >= v"0.4.0-dev+6521" && __precompile__()` before your `module` statement, so that Julia knows to precompile before anything in your module is evaluated.)

## Renamed functions

* `itrunc`, `iround`, `iceil`, `ifloor` are now accessed via `trunc(T, x)`, etc. [#9133](https://github.com/JuliaLang/julia/pull/9133)
Expand Down
10 changes: 10 additions & 0 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -533,4 +533,14 @@ if VERSION < v"0.4.0-dev+5697"
export Mmap
end

if VERSION < v"0.4.0-dev+6521"
__precompile__(::Bool) = nothing
export __precompile__
end

if VERSION < v"0.4.0-dev+6506"
include_dependency(::AbstractString) = nothing
export include_dependency
end

end # module
3 changes: 3 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -409,3 +409,6 @@ Compat.@irrational mathconst_one 1.0 big(1.)
@compat utf8(Mmap.mmap(@__FILE__(),Vector{Uint8},11,1)) == "sing Compat"

@test base64encode("hello world") == "aGVsbG8gd29ybGQ="

@test nothing === __precompile__(false) # tests should never be precompiled
@test nothing === include_dependency("foo")

0 comments on commit e324d63

Please sign in to comment.