Auto merge of #6852 - huonw:fix-alignment, r=pcwalton

Avoid undefined behaviour by allocating with align 1.

The allocation APIs require that the alignment is a power-of-two;
meaning 1 is the "I don't care" alignment, not 0.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/6852)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2015-07-30 12:35:26 -06:00
commit 3792bd7611

View file

@ -25,7 +25,7 @@ struct User {
}
// FreeType doesn't require any particular alignment for allocations.
const FT_ALIGNMENT: usize = 0;
const FT_ALIGNMENT: usize = 1;
extern fn ft_alloc(mem: FT_Memory, req_size: c_long) -> *mut c_void {
unsafe {