From 7a172be6213839a3d023ba21c3bafd7540a4bfe8 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 31 Mar 2025 02:11:03 -0400 Subject: Remove threads and mutexed data from the language in favor of a module-based approach --- src/types.c | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'src/types.c') diff --git a/src/types.c b/src/types.c index 07b6ced0..c4155c8d 100644 --- a/src/types.c +++ b/src/types.c @@ -84,13 +84,6 @@ CORD type_to_cord(type_t *t) { else return "(Unknown optional type)"; } - case MutexedType: { - type_t *opt = Match(t, MutexedType)->type; - if (opt) - return CORD_all("mutexed ", type_to_cord(opt)); - else - return "(Unknown optional type)"; - } case TypeInfoType: { return CORD_all("Type$info(", Match(t, TypeInfoType)->name, ")"); } @@ -250,7 +243,6 @@ PUREFUNC bool has_heap_memory(type_t *t) case SetType: return true; case PointerType: return true; case OptionalType: return has_heap_memory(Match(t, OptionalType)->type); - case MutexedType: return true; case BigIntType: return true; case StructType: { for (arg_t *field = Match(t, StructType)->fields; field; field = field->next) { @@ -276,7 +268,6 @@ PUREFUNC bool has_stack_memory(type_t *t) switch (t->tag) { case PointerType: return Match(t, PointerType)->is_stack; case OptionalType: return has_stack_memory(Match(t, OptionalType)->type); - case MutexedType: return has_stack_memory(Match(t, MutexedType)->type); default: return false; } } @@ -483,7 +474,6 @@ 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*); if (t == PATH_TYPE) return sizeof(Path_t); if (t == PATH_TYPE_TYPE) return sizeof(PathType_t); #ifdef __GNUC__ @@ -514,7 +504,6 @@ PUREFUNC size_t type_size(type_t *t) case FunctionType: return sizeof(void*); case ClosureType: return sizeof(struct {void *fn, *userdata;}); case PointerType: return sizeof(void*); - case MutexedType: return sizeof(MutexedData_t); case OptionalType: { type_t *nonnull = Match(t, OptionalType)->type; switch (nonnull->tag) { @@ -575,7 +564,6 @@ PUREFUNC size_t type_size(type_t *t) PUREFUNC size_t type_align(type_t *t) { - if (t == THREAD_TYPE) return __alignof__(pthread_t*); if (t == PATH_TYPE) return __alignof__(Path_t); if (t == PATH_TYPE_TYPE) return __alignof__(PathType_t); #ifdef __GNUC__ @@ -606,7 +594,6 @@ PUREFUNC size_t type_align(type_t *t) case FunctionType: return __alignof__(void*); case ClosureType: return __alignof__(struct {void *fn, *userdata;}); case PointerType: return __alignof__(void*); - case MutexedType: return __alignof__(MutexedData_t); case OptionalType: { type_t *nonnull = Match(t, OptionalType)->type; switch (nonnull->tag) { -- cgit v1.2.3