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.
This commit is contained in:
Huon Wilson 2015-07-30 10:35:00 -07:00
parent 82e476fd07
commit b42117fe0c

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 {