Created
July 24, 2018 11:39
-
-
Save carlobaldassi/0467d469f2c7de5bcf5c32f686ea0818 to your computer and use it in GitHub Desktop.
scripts to reproduce JLD issues on julia 0.7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Tst | |
using JLD | |
GC.gc() | |
Aarray = Vector{Float64}[[1.2,3.4],[1.1]] | |
str = "abc" | |
stringsA = ["x","y","z"] | |
strings16 = convert(Vector{JLD.UTF16String}, stringsA) | |
bigdata = [1:10000;] | |
fn = "tst.tmp.jld" | |
fid = jldopen(fn, "w") | |
write(fid, "Aarray", Aarray) | |
write(fid, "str", str) | |
write(fid, "stringsA", stringsA) | |
write(fid, "stringsU", stringsA) | |
write(fid, "strings16", strings16) | |
write(fid, "bigdata", bigdata) | |
close(fid) | |
fidr = jldopen(fn, "r", mmaparrays=true) | |
try | |
read(fidr, "bigdata") == bigdata | |
finally | |
close(fidr) | |
end | |
GC.gc() | |
end # module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Tst2 | |
using JLD | |
GC.gc() | |
struct BitsUnion | |
x::Union{Int64, Float64} | |
end | |
bitsunion = BitsUnion(5.0) | |
fn = "tst.tmp.jld" | |
fid = jldopen(fn, "w") | |
write(fid, "bitsunion", bitsunion) | |
close(fid) | |
fidr = jldopen(fn, "r", mmaparrays=true) | |
try | |
read(fidr, "bitsunion") == bitsunion | |
finally | |
close(fidr) | |
end | |
GC.gc() | |
end # module |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment