From 500e4e1bd74b45476c4df0f4f9da72fbada9bb18 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 2 Jan 2025 18:20:58 -0500 Subject: Fix issue for size/alignment of threads --- types.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/types.c b/types.c index 08fcedab..92a3c270 100644 --- a/types.c +++ b/types.c @@ -6,10 +6,11 @@ #include #include +#include "cordhelpers.h" +#include "environment.h" #include "stdlib/integers.h" #include "stdlib/tables.h" #include "stdlib/util.h" -#include "cordhelpers.h" #include "types.h" CORD type_to_cord(type_t *t) { @@ -469,6 +470,7 @@ PUREFUNC size_t unpadded_struct_size(type_t *t) PUREFUNC size_t type_size(type_t *t) { + if (t == THREAD_TYPE) return sizeof(pthread_t*); #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wswitch-default" switch (t->tag) { @@ -552,6 +554,7 @@ PUREFUNC size_t type_size(type_t *t) PUREFUNC size_t type_align(type_t *t) { + if (t == THREAD_TYPE) return __alignof__(pthread_t*); #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wswitch-default" switch (t->tag) { -- cgit v1.2.3