Skip to content

Commit

Permalink
deserialize MethodTables in a world-aware manner
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash committed Jun 22, 2016
1 parent 50a6216 commit cb2ea2c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions base/serialize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ function serialize_typename_body(s::AbstractSerializer, t::TypeName)
serialize(s, t.primary.ninitialized)
if isdefined(t, :mt)
serialize(s, t.mt.name)
serialize(s, t.mt.defs)
serialize(s, collect(Base.MethodList(t.mt)))
serialize(s, t.mt.max_args)
if isdefined(t.mt, :kwsorter)
serialize(s, t.mt.kwsorter)
Expand Down Expand Up @@ -794,8 +794,10 @@ function deserialize_typename_body(s::AbstractSerializer, tn, number, name, mod,
if makenew
tn.mt = ccall(:jl_new_method_table, Any, (Any, Any), name, mod)
tn.mt.name = mtname
tn.mt.defs = defs
tn.mt.max_args = maxa
for def in defs
ccall(:jl_method_table_insert, Void, (Any, Any, Ptr{Void}), tn.mt, def, C_NULL)
end
end
tag = Int32(read(s.io, UInt8)::UInt8)
if tag != UNDEFREF_TAG
Expand Down
2 changes: 1 addition & 1 deletion src/gf.c
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ static int invalidate_conflicting(jl_typemap_entry_t *oldentry, struct typemap_i
return 1;
}

void jl_method_table_insert(jl_methtable_t *mt, jl_method_t *method, jl_tupletype_t *simpletype)
JL_DLLEXPORT void jl_method_table_insert(jl_methtable_t *mt, jl_method_t *method, jl_tupletype_t *simpletype)
{
assert(jl_is_method(method));
assert(jl_is_mtable(mt));
Expand Down

0 comments on commit cb2ea2c

Please sign in to comment.