aboutsummaryrefslogtreecommitdiff
path: root/src/boot/me/trans.ml
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2011-04-02 19:03:43 -0700
committerGraydon Hoare <[email protected]>2011-04-02 19:05:12 -0700
commit8e9c5b96fbaa338e0b60e3e8c0127e0b3e4cee76 (patch)
treec893449b391e9aec1c6aa3299ab975b4cd053be0 /src/boot/me/trans.ml
parentGitignore the recommended build directory (diff)
downloadrust-8e9c5b96fbaa338e0b60e3e8c0127e0b3e4cee76.tar.xz
rust-8e9c5b96fbaa338e0b60e3e8c0127e0b3e4cee76.zip
Change rust_vec to have a 16-byte header, to 16-byte-align vec-body data. Major perf win.
Diffstat (limited to 'src/boot/me/trans.ml')
-rw-r--r--src/boot/me/trans.ml8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/boot/me/trans.ml b/src/boot/me/trans.ml
index e99ea8f9..bb74d721 100644
--- a/src/boot/me/trans.ml
+++ b/src/boot/me/trans.ml
@@ -1549,6 +1549,7 @@ let trans_visitor
Asm.IMM Abi.const_refcount);
Asm.WORD (word_ty_mach, Asm.IMM init_sz);
Asm.WORD (word_ty_mach, Asm.IMM init_sz);
+ Asm.WORD (word_ty_mach, Asm.IMM 0L);
Asm.ZSTRING s
|]))
(referent_type cx Ast.TY_str)
@@ -2850,15 +2851,16 @@ let trans_visitor
(*
* A vec is implicitly boxed: every slot vec[T] is 1 word and
- * points to a refcounted structure. That structure has 3 words with
+ * points to a refcounted structure. That structure has 4 words with
* defined meaning at the beginning; data follows the header.
*
* word 0: refcount or gc control word
* word 1: allocated size of data
* word 2: initialised size of data
- * word 3...N: data
+ * word 3: padding word to hit even multiple of 16
+ * word 4...N: data
*
- * This 3-word prefix is shared with strings, we factor the common
+ * This 4-word prefix is shared with strings, we factor the common
* part out for reuse in string code.
*)