Skip to content

Commit af97d70

Browse files
committed
move Mmap and SharedArrays to stdlib
1 parent 68e3901 commit af97d70

File tree

19 files changed

+377
-341
lines changed

19 files changed

+377
-341
lines changed

base/deprecated.jl

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,14 +1014,6 @@ isempty(::Task) = error("isempty not defined for Tasks")
10141014
@deprecate Array(::Type{T}, m::Integer,n::Integer) where {T} Array{T}(Int(m),Int(n))
10151015
@deprecate Array(::Type{T}, m::Integer,n::Integer,o::Integer) where {T} Array{T}(Int(m),Int(n),Int(o))
10161016

1017-
# Likewise for SharedArrays
1018-
@deprecate SharedArray(::Type{T}, dims::Dims{N}; kwargs...) where {T,N} SharedArray{T}(dims; kwargs...)
1019-
@deprecate SharedArray(::Type{T}, dims::Int...; kwargs...) where {T} SharedArray{T}(dims...; kwargs...)
1020-
@deprecate(SharedArray(filename::AbstractString, ::Type{T}, dims::NTuple{N,Int}, offset; kwargs...) where {T,N},
1021-
SharedArray{T}(filename, dims, offset; kwargs...))
1022-
@deprecate(SharedArray(filename::AbstractString, ::Type{T}, dims::NTuple, offset; kwargs...) where {T},
1023-
SharedArray{T}(filename, dims, offset; kwargs...))
1024-
10251017
@noinline function is_intrinsic_expr(@nospecialize(x))
10261018
Base.depwarn("is_intrinsic_expr is deprecated. There are no intrinsic functions anymore.", :is_intrinsic_expr)
10271019
return false
@@ -1381,6 +1373,10 @@ end
13811373
export Test
13821374
deprecate(@__MODULE__, :Test)
13831375

1376+
@deprecate_moved SharedArray "SharedArrays" true true
1377+
1378+
@deprecate_binding Mmap nothing true ", run `using Mmap` instead"
1379+
13841380
# PR #21709
13851381
@deprecate cov(x::AbstractVector, corrected::Bool) cov(x, corrected=corrected)
13861382
@deprecate cov(x::AbstractMatrix, vardim::Int, corrected::Bool) cov(x, vardim, corrected=corrected)

base/exports.jl

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ export
1111
Sys,
1212
Libc,
1313
Libdl,
14-
Mmap,
1514
LinAlg,
1615
BLAS,
1716
LAPACK,
@@ -104,9 +103,6 @@ export
104103
AbstractSerializer,
105104
SerializationState,
106105
Set,
107-
SharedArray,
108-
SharedMatrix,
109-
SharedVector,
110106
StepRange,
111107
StepRangeLen,
112108
StridedArray,
@@ -1088,11 +1084,6 @@ export
10881084
HTML,
10891085
Text,
10901086

1091-
# shared arrays
1092-
sdata,
1093-
indexpids,
1094-
localindexes,
1095-
10961087
# paths and file names
10971088
abspath,
10981089
basename,

base/sysimg.jl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -355,10 +355,6 @@ using .Serializer
355355
import .Serializer: serialize, deserialize
356356
include("channels.jl")
357357

358-
# memory-mapped and shared arrays
359-
include("mmap.jl")
360-
import .Mmap
361-
362358
# utilities - timing, help, edit
363359
include("deepcopy.jl")
364360
include("interactiveutil.jl")
@@ -413,7 +409,6 @@ include("asyncmap.jl")
413409

414410
include("distributed/Distributed.jl")
415411
using .Distributed
416-
include("sharedarray.jl")
417412

418413
# code loading
419414
include("loading.jl")

doc/make.jl

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,20 @@ end
1616

1717
# Documenter Setup.
1818

19+
symlink_q(tgt, link) = isfile(link) || symlink(tgt, link)
20+
cp_q(src, dest) = isfile(dest) || cp(src, dest)
21+
1922
# make links for stdlib package docs
2023
if Sys.iswindows()
21-
cp("../stdlib/DelimitedFiles/docs/src/index.md", "src/stdlib/delimitedfiles.md")
22-
cp("../stdlib/Test/docs/src/index.md", "src/stdlib/test.md")
24+
cp_q("../stdlib/DelimitedFiles/docs/src/index.md", "src/stdlib/delimitedfiles.md")
25+
cp_q("../stdlib/Test/docs/src/index.md", "src/stdlib/test.md")
26+
cp_q("../stdlib/Mmap/docs/src/index.md", "src/stdlib/mmap.md")
27+
cp_q("../stdlib/SharedArrays/docs/src/index.md", "src/stdlib/sharedarrays.md")
2328
else
24-
symlink("../../../stdlib/DelimitedFiles/docs/src/index.md", "src/stdlib/delimitedfiles.md")
25-
symlink("../../../stdlib/Test/docs/src/index.md", "src/stdlib/test.md")
29+
symlink_q("../../../stdlib/DelimitedFiles/docs/src/index.md", "src/stdlib/delimitedfiles.md")
30+
symlink_q("../../../stdlib/Test/docs/src/index.md", "src/stdlib/test.md")
31+
symlink_q("../../../stdlib/Mmap/docs/src/index.md", "src/stdlib/mmap.md")
32+
symlink_q("../../../stdlib/SharedArrays/docs/src/index.md", "src/stdlib/sharedarrays.md")
2633
end
2734

2835
const PAGES = [
@@ -126,11 +133,11 @@ const PAGES = [
126133
],
127134
]
128135

129-
using DelimitedFiles, Test
136+
using DelimitedFiles, Test, Mmap, SharedArrays
130137

131138
makedocs(
132139
build = joinpath(pwd(), "_build/html/en"),
133-
modules = [Base, Core, BuildSysImg, DelimitedFiles, Test],
140+
modules = [Base, Core, BuildSysImg, DelimitedFiles, Test, Mmap, SharedArrays],
134141
clean = false,
135142
doctest = "doctest" in ARGS,
136143
linkcheck = "linkcheck" in ARGS,

doc/src/manual/parallel-computing.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,9 @@ julia> addprocs(3)
858858
3
859859
4
860860
861-
julia> S = SharedArray{Int,2}((3,4), init = S -> S[Base.localindexes(S)] = myid())
861+
julia> @everywhere using SharedArrays
862+
863+
julia> S = SharedArray{Int,2}((3,4), init = S -> S[localindexes(S)] = myid())
862864
3×4 SharedArray{Int64,2}:
863865
2 2 3 4
864866
2 3 3 4
@@ -874,7 +876,7 @@ julia> S
874876
2 7 4 4
875877
```
876878

877-
[`Base.localindexes`](@ref) provides disjoint one-dimensional ranges of indexes, and is sometimes
879+
[`SharedArrays.localindexes`](@ref) provides disjoint one-dimensional ranges of indexes, and is sometimes
878880
convenient for splitting up tasks among processes. You can, of course, divide the work any way
879881
you wish:
880882

doc/src/stdlib/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
delimitedfiles.md
22
test.md
3+
mmap.md
4+
sharedarrays.md

doc/src/stdlib/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,5 @@
2424
* [Dynamic Linker](@ref)
2525
* [Profiling](@ref lib-profiling)
2626
* [SIMD Support](@ref)
27+
* [Memory-mapped I/O](@ref)
28+
* [Shared Arrays](@ref)

doc/src/stdlib/io-network.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -136,14 +136,6 @@ Base.Multimedia.TextDisplay
136136
Base.Multimedia.istextmime
137137
```
138138

139-
## Memory-mapped I/O
140-
141-
```@docs
142-
Base.Mmap.Anonymous
143-
Base.Mmap.mmap
144-
Base.Mmap.sync!
145-
```
146-
147139
## Network I/O
148140

149141
```@docs

doc/src/stdlib/parallel.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,6 @@ Base.cluster_cookie()
8383
Base.cluster_cookie(::Any)
8484
```
8585

86-
## Shared Arrays
87-
88-
```@docs
89-
Base.SharedArray
90-
Base.procs(::SharedArray)
91-
Base.sdata
92-
Base.indexpids
93-
Base.localindexes
94-
```
95-
9686
## Multi-Threading
9787

9888
This experimental interface supports Julia's multi-threading capabilities. Types and functions

stdlib/DelimitedFiles/src/DelimitedFiles.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ __precompile__(true)
44

55
module DelimitedFiles
66

7+
using Mmap
8+
79
import Base: _default_delims, tryparse_internal, show
810

911
export readdlm, writedlm

0 commit comments

Comments
 (0)