Skip to content

Commit

Permalink
Move mysnc docstring out of unix_only block.
Browse files Browse the repository at this point in the history
  • Loading branch information
hayd committed Jan 3, 2016
1 parent e55c22a commit fa13a73
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,21 @@ export @math_const
# 11280, mmap

export msync

"""
msync(ptr, len, [flags])
Forces synchronization of the [`mmap`](:func:`mmap`)ped memory region from `ptr` to
`ptr+len`. Flags defaults to `MS_SYNC`, but can be a combination of `MS_ASYNC`, `MS_SYNC`,
or `MS_INVALIDATE`. See your platform man page for specifics. The flags argument is not
valid on Windows.
You may not need to call `msync`, because synchronization is performed at intervals
automatically by the operating system. However, you can call this directly if, for example,
you are concerned about losing the result of a long-running calculation.
"""
function msync end

msync{T}(A::Array{T}) = msync(pointer(A), length(A)*sizeof(T))
msync(B::BitArray) = msync(pointer(B.chunks), length(B.chunks)*sizeof(UInt64))

Expand Down Expand Up @@ -608,18 +623,6 @@ end
const MS_ASYNC = 1
const MS_INVALIDATE = 2
const MS_SYNC = 4
"""
msync(ptr, len, [flags])
Forces synchronization of the [`mmap`](:func:`mmap`)ped memory region from `ptr` to
`ptr+len`. Flags defaults to `MS_SYNC`, but can be a combination of `MS_ASYNC`, `MS_SYNC`,
or `MS_INVALIDATE`. See your platform man page for specifics. The flags argument is not
valid on Windows.
You may not need to call `msync`, because synchronization is performed at intervals
automatically by the operating system. However, you can call this directly if, for example,
you are concerned about losing the result of a long-running calculation.
"""
@noinline function msync(p::Ptr, len::Integer, flags::Integer=MS_SYNC)
depwarn("`msync` is deprecated, use `Mmap.sync!(array)` instead", :msync)
systemerror("msync", ccall(:msync, Cint, (Ptr{Void}, Csize_t, Cint), p, len, flags) != 0)
Expand Down

0 comments on commit fa13a73

Please sign in to comment.