obj: object header is no longer allocated automatically
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user