obj: object header is no longer allocated automatically

This commit is contained in:
2023-05-06 19:48:14 +01:00
parent 79c30e5393
commit f52ca2f1e2
13 changed files with 97 additions and 66 deletions

View File

@@ -3,6 +3,8 @@
#include <socks/cpu.h>
#include <socks/machine/thread.h>
#define THREAD_CAST(p) OBJECT_C_CAST(struct thread, thr_base, &thread_type, p)
static struct object_type thread_type = {
.ob_name = "thread",
.ob_size = sizeof(struct thread),
@@ -20,7 +22,7 @@ struct thread *thread_alloc(void)
return NULL;
}
struct thread *t = object_data(thread_obj);
struct thread *t = THREAD_CAST(thread_obj);
memset(t, 0x00, sizeof *t);
return t;
}