Skip to content

Commit

Permalink
Renamed ObjectIdDict -> IdDict{K,V} and added {K,V} (#25210)
Browse files Browse the repository at this point in the history
- also updated constuctors to be in-line with Dict
- added some extra tests
  • Loading branch information
mauro3 authored and JeffBezanson committed Jan 17, 2018
1 parent 43f6398 commit ce64d7d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/cluster.jl
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ const LPROC = LocalProcess()
const HDR_VERSION_LEN=16
const HDR_COOKIE_LEN=16
const map_pid_wrkr = Dict{Int, Union{Worker, LocalProcess}}()
const map_sock_wrkr = ObjectIdDict()
const map_sock_wrkr = IdDict()
const map_del_wrkr = Set{Int}()

# cluster management related API
Expand Down
5 changes: 2 additions & 3 deletions src/clusterserialize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Base.Serializer: object_number, lookup_object_number, remember_object
mutable struct ClusterSerializer{I<:IO} <: AbstractSerializer
io::I
counter::Int
table::ObjectIdDict
table::IdDict
pending_refs::Vector{Int}

pid::Int # Worker we are connected to.
Expand All @@ -20,7 +20,7 @@ mutable struct ClusterSerializer{I<:IO} <: AbstractSerializer
anonfunc_id::UInt64

function ClusterSerializer{I}(io::I) where I<:IO
new(io, 0, ObjectIdDict(), Int[], worker_id_from_socket(io),
new(io, 0, IdDict(), Int[], worker_id_from_socket(io),
Set{UInt64}(), Dict{UInt64, UInt64}(), Dict{UInt64, Vector{Symbol}}(), 0)
end
end
Expand Down Expand Up @@ -265,4 +265,3 @@ clear!(syms, pid::Int; mod=Main) = clear!(syms, [pid]; mod=mod)

clear_impl!(syms, mod::Module) = foreach(x->clear_impl!(x,mod), syms)
clear_impl!(sym::Symbol, mod::Module) = isdefined(mod, sym) && @eval(mod, global $sym = nothing)

0 comments on commit ce64d7d

Please sign in to comment.