Skip to content

Commit

Permalink
Merge pull request #233 from JuliaIO/jb/Ptr
Browse files Browse the repository at this point in the history
allow saving Ptrs
  • Loading branch information
JeffBezanson authored Nov 8, 2018
2 parents 08315b9 + c2d5627 commit 22ef516
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 8 deletions.
3 changes: 0 additions & 3 deletions src/JLD.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1126,9 +1126,6 @@ function save_write(f, s, vname, wsession::JldWriteSession)
try
write(f, s, vname)
catch e
if isa(e, PointerException)
@warn("Skipping $vname because it contains a pointer")
end
end
end
end
Expand Down
4 changes: 0 additions & 4 deletions src/jld_types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,6 @@ end
jlconvert(::Type{T}, file::JldFile, ptr::Ptr) where {T<:Type} =
julia_type(jlconvert(String, file, ptr))

## Pointers

h5type(parent::JldFile, ::Type{T}, ::Bool) where {T<:Ptr} = throw(PointerException())

## Union{}

h5fieldtype(parent::JldFile, ::Type{Union{}}, ::Bool) = JLD_REF_TYPE
Expand Down
2 changes: 1 addition & 1 deletion test/jldtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ for compatible in (false, true), compress in (false, true)
@write fid undefv
@write fid undefm
@write fid ms_undef
@test_throws JLD.PointerException @write fid objwithpointer
@write fid objwithpointer
@write fid bt
@write fid sa_asc
@write fid sa_utf8
Expand Down

0 comments on commit 22ef516

Please sign in to comment.