diff --git a/lvgl/src/mem.rs b/lvgl/src/mem.rs index a8cbc40..efd992e 100644 --- a/lvgl/src/mem.rs +++ b/lvgl/src/mem.rs @@ -7,13 +7,11 @@ pub(crate) struct Box(NonNull); impl Box { pub fn new(inner: T) -> LvResult> { - assert_ne!(mem::size_of::(), 0, "We don't handle ZSTs"); - let size = mem::size_of::(); let inner = unsafe { - // LVGL already aligns the memory address for us let ptr = lvgl_sys::lv_mem_alloc(size as lvgl_sys::size_t) as *mut T; + // LVGL should align the memory address for us! assert_eq!( ptr as usize % mem::align_of::(), 0,