From 5bbcd2c036dd19d3293d9abc4d44014a5108a5ed Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Sun, 11 Oct 2026 23:35:00 +0300 Subject: opt: shrink input event to 48B, pack mouse event to 32B, and shave 2KB off yasl_surface - Compact yasl_mouse_event from 36B to 32B (half a cacheline, 0 holes) - Compact yasl_input_event from 56B to 48B (0 holes) - Reduce yasl_surface by 2,048 bytes (shaving 32 full cachelines per surface) - Optimize UTF-8 sanitize with vectorized validation fast-path - Fast-path MIME prefix match in clipboard transfers --- include/yasl/yasl.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/yasl/yasl.h b/include/yasl/yasl.h index 081e1f0..c211a0b 100644 --- a/include/yasl/yasl.h +++ b/include/yasl/yasl.h @@ -208,12 +208,12 @@ struct yasl_key_event { struct yasl_mouse_event { struct yasl_vector2i pos; - int button; + int16_t button; + int16_t scroll_lines; enum yasl_pointer_kind kind; + enum yasl_pointer_device device; uint32_t mods; - int scroll_lines; float scroll_delta; - enum yasl_pointer_device device; struct yasl_pointer_pen pen; }; @@ -227,8 +227,9 @@ enum yasl_input_kind { }; struct yasl_input_event { - enum yasl_input_kind kind; struct yasl_surface *surface; + enum yasl_input_kind kind; + uint32_t reserved; union { struct yasl_key_event key; struct yasl_mouse_event mouse; -- cgit v1.2.3