layout: Shrink fragments down from 448 bytes down to 128 bytes.

16% performance improvement in layout (!)
This commit is contained in:
Patrick Walton 2014-10-21 23:08:02 -07:00
parent 2df236376a
commit de5e2fd5e2
8 changed files with 128 additions and 88 deletions

View file

@ -92,8 +92,8 @@ impl Drop for Scope {
/// Generate a unique ID. This is used for items such as Fragment
/// which are often reallocated but represent essentially the
/// same data.
pub fn generate_unique_debug_id() -> uint {
unsafe { DEBUG_ID_COUNTER.fetch_add(1, SeqCst) }
pub fn generate_unique_debug_id() -> u16 {
unsafe { DEBUG_ID_COUNTER.fetch_add(1, SeqCst) as u16 }
}
/// Begin a layout debug trace. If this has not been called,