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

@@ -6,6 +6,8 @@
#include <socks/cpu.h>
#include <socks/libc/stdio.h>
#define TASK_CAST(p) OBJECT_C_CAST(struct task, t_base, &task_type, p)
static struct object_type task_type = {
.ob_name = "task",
.ob_size = sizeof(struct task),
@@ -144,7 +146,7 @@ struct task *task_alloc(void)
return NULL;
}
struct task *t = object_data(task_obj);
struct task *t = TASK_CAST(task_obj);
memset(t, 0x00, sizeof *t);
return t;
}