Skip to content

Commit

Permalink
fix a missing GC root
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Apr 16, 2015
1 parent c1f38e7 commit fb78bdb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ jl_typename_t *jl_new_typename(jl_sym_t *name)
tn->module = jl_current_module;
tn->primary = NULL;
tn->cache = (jl_value_t*)jl_emptysvec;
tn->names = NULL;
tn->uid = jl_assign_type_uid();
return tn;
}
Expand Down
5 changes: 4 additions & 1 deletion src/jl_uv.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ DLLEXPORT void jl_uv_alloc_buf(uv_handle_t *handle, size_t suggested_size, uv_bu
{
if (handle->data) {
jl_value_t *ret = JULIA_CB(alloc_buf,handle->data,1,CB_UINT,suggested_size);
assert(jl_is_tuple(ret) && jl_is_pointer(jl_fieldref(ret,0)));
JL_GC_PUSH1(&ret);
// TODO: jl_fieldref allocates boxes here. should avoid that.
assert(jl_is_tuple(ret) && jl_nfields(ret)==2 && jl_is_pointer(jl_fieldref(ret,0)));
buf->base = jl_unbox_voidpointer(jl_fieldref(ret,0));
#ifdef _P64
assert(jl_is_uint64(jl_fieldref(ret,1)));
Expand All @@ -187,6 +189,7 @@ DLLEXPORT void jl_uv_alloc_buf(uv_handle_t *handle, size_t suggested_size, uv_bu
assert(jl_is_uint32(jl_fieldref(ret,1)));
buf->len = jl_unbox_uint32(jl_fieldref(ret,1));
#endif
JL_GC_POP();
}
else {
buf->len = 0;
Expand Down

0 comments on commit fb78bdb

Please sign in to comment.