about summary refs log tree commit diff
path: root/src/rt/rust_kernel.cpp
diff options
context:
space:
mode:
authorMarijn Haverbeke <marijnh@gmail.com>2012-02-03 15:15:28 +0100
committerMarijn Haverbeke <marijnh@gmail.com>2012-02-06 16:53:25 +0100
commit8673c4f195be8377f8e0d83929f9a16bb99092a0 (patch)
tree809c4016f5c84da9adf08a756e67bda6b5bf6b07 /src/rt/rust_kernel.cpp
parent6ed8d037841aab1b2855525bf141c5c1c4de4910 (diff)
downloadrust-8673c4f195be8377f8e0d83929f9a16bb99092a0.tar.gz
rust-8673c4f195be8377f8e0d83929f9a16bb99092a0.zip
Make ty::t type self-sufficient
It is now no longer needed to have a ty::ctxt to get at the contents
of a ty::t. The straight-forward approach of doing this, simply making
ty::t a box type, unfortunately killed our compiler performance (~15%
slower) through refcounting cost. Thus, this patch now represents
ty::t as an unsafe pointer, assuming that the ty::ctxt, which holds
these boxes alive, outlives any uses of the ty::t values. In the
current compiler this trivially holds, but it is does of course add a
new potential pitfall.

ty::get takes a ty::t and returns a boxed representation of the type.
I've changed calls to ty::struct(X) to do ty::get(X).struct. Type
structs are full of vectors, and copying them every time we wanted to
access them was a bit of a cost.
Diffstat (limited to 'src/rt/rust_kernel.cpp')
0 files changed, 0 insertions, 0 deletions