Skip to content

Commit

Permalink
Merge branch 'pv-alloc-profile-docs-feedback' into pv-alloc-profile-docs
Browse files Browse the repository at this point in the history
  • Loading branch information
vilterp committed Jan 7, 2022
2 parents 4fec8dd + 9a4b7fb commit 5dc2beb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions stdlib/Profile/docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ Profile.Allocs.@profile
The methods in `Profile.Allocs` are not exported and need to be called e.g. as `Profile.Allocs.fetch()`.

```@docs
Profile.Allocs.start
Profile.Allocs.stop
Profile.Allocs.clear
Profile.Allocs.fetch
Profile.Allocs.start
Profile.Allocs.stop
```
10 changes: 5 additions & 5 deletions stdlib/Profile/src/Allocs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ end
Profile allocations that happen during `expr`, returning
both the result and and AllocResults struct.
A sample rate of 1 will record everything; 0 will record nothing.
A sample rate of 1.0 will record everything; 0.0 will record nothing.
```julia
julia> Profile.Allocs.@profile sample_rate=0.01 peakflops()
Expand Down Expand Up @@ -62,12 +62,12 @@ function _prof_expr(expr, opts)
end

"""
Profile.Allocs.start(sample_rate::Number)
Profile.Allocs.start(sample_rate::Real)
Begin recording allocations with the given sample rate
A sample rate of 1 will record everything; 0 will record nothing.
A sample rate of 1.0 will record everything; 0.0 will record nothing.
"""
function start(; sample_rate::Number)
function start(; sample_rate::Real)
ccall(:jl_start_alloc_profile, Cvoid, (Cdouble,), Float64(sample_rate))
end

Expand All @@ -83,7 +83,7 @@ end
"""
Profile.Allocs.clear()
Clear allocation information from memory.
Clear all previously profiled allocation information from memory.
"""
function clear()
ccall(:jl_free_alloc_profile, Cvoid, ())
Expand Down

0 comments on commit 5dc2beb

Please sign in to comment.