rt: Remember the number of captured type descriptors for objects in the type descriptor crate cache

This commit is contained in:
Patrick Walton 2011-08-25 14:20:21 -07:00
parent 608f7ccded
commit 8bd019bdc8
3 changed files with 12 additions and 1 deletions

View file

@ -958,10 +958,13 @@ fn get_derived_tydesc(cx: &@block_ctxt, t: ty::t, escapes: bool,
// If the tydesc escapes in this context, the cached derived
// tydesc also has to be one that was marked as escaping.
if !(escapes && !info.escapes) { ret rslt(cx, info.lltydesc); }
if !(escapes && !info.escapes) && storage == tps_normal {
ret rslt(cx, info.lltydesc);
}
}
none. {/* fall through */ }
}
bcx_ccx(cx).stats.n_derived_tydescs += 1u;
let bcx = new_raw_block_ctxt(cx.fcx, cx.fcx.llderivedtydescs);
let tys = linearize_ty_params(bcx, t);