From 5da3fdc08e724c06c397688ca39a14dd1ab62000 Mon Sep 17 00:00:00 2001 From: Ben Lubar Date: Wed, 14 Oct 2026 10:58:14 -0500 Subject: [PATCH] Fix alignment of `RID` and `Packed*Array` on 32-bit x86 (Linux). --- binding_generator.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/binding_generator.py b/binding_generator.py index af26d3e4b..dc6e66274 100644 --- a/binding_generator.py +++ b/binding_generator.py @@ -802,6 +802,10 @@ def generate_builtin_class_header(builtin_api, size, used_classes, fully_used_cl # We don't get alignment information from the JSON so we have to guess. # This logic should be correct for all built-in types as they exist right now. alignment = 8 if size >= 8 else 4 + if class_name == "RID": + alignment = "uint64_t" + elif is_packed_array(class_name): + alignment = "void *" result.append(f"\talignas({alignment}) uint8_t opaque[{snake_class_name}_SIZE] = {{}};") result.append("")