Commit be5eab1f authored by David Michael Barr's avatar David Michael Barr Committed by Luca Barbato

Align PlaneData to 32 bytes on Windows

parent d0032a5e
......@@ -90,9 +90,6 @@ impl<T: Pixel> std::ops::Drop for PlaneData<T> {
impl<T: Pixel> PlaneData<T> {
/// Data alignment in bytes.
#[cfg(windows)]
const DATA_ALIGNMENT_LOG2: usize = 4;
#[cfg(not(windows))]
const DATA_ALIGNMENT_LOG2: usize = 5;
unsafe fn layout(len: usize) -> Layout {
......@@ -149,17 +146,8 @@ impl<T: Pixel> Debug for Plane<T>
impl<T: Pixel> Plane<T> {
/// Stride alignment in bytes.
#[cfg(windows)]
const STRIDE_ALIGNMENT_LOG2: usize = 4;
#[cfg(not(windows))]
const STRIDE_ALIGNMENT_LOG2: usize = 5;
/// Data alignment in bytes.
#[cfg(windows)]
const DATA_ALIGNMENT_LOG2: usize = 4;
#[cfg(not(windows))]
const DATA_ALIGNMENT_LOG2: usize = 5;
pub fn new(
width: usize, height: usize, xdec: usize, ydec: usize, xpad: usize,
ypad: usize
......@@ -174,7 +162,6 @@ impl<T: Pixel> Plane<T> {
let alloc_height = yorigin + height + ypad;
let data = PlaneData::new(stride * alloc_height);
assert!(is_aligned(data.as_ptr(), Self::DATA_ALIGNMENT_LOG2));
Plane {
data,
cfg: PlaneConfig {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment