mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
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:
commit
3792bd7611
1 changed files with 1 additions and 1 deletions
|
@ -25,7 +25,7 @@ struct User {
|
||||||
}
|
}
|
||||||
|
|
||||||
// FreeType doesn't require any particular alignment for allocations.
|
// 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 {
|
extern fn ft_alloc(mem: FT_Memory, req_size: c_long) -> *mut c_void {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue