feat: reduce memset size
This commit is contained in:
parent
9f8e7740e4
commit
bf8e6e9d0d
@ -103,7 +103,7 @@ int thread_create(thread_t* newthread, void* (*func)(void*), void* funcarg)
|
||||
{
|
||||
TRACE("Create a new thread that execute function %p", func);
|
||||
struct context_entry* new_entry = malloc(sizeof(*new_entry));
|
||||
memset(new_entry, 0, sizeof(*new_entry));
|
||||
memset(new_entry->stack, 0, STACK_SIZE);
|
||||
|
||||
getcontext(&new_entry->context);
|
||||
|
||||
@ -222,7 +222,7 @@ void __attribute__((constructor)) setup_main_thread()
|
||||
TRACE("premain");
|
||||
// Create an entry for the main thread.
|
||||
struct context_entry* main = malloc(sizeof(*main));
|
||||
memset(main, 0, sizeof(*main));
|
||||
// memset(main, 0, sizeof(*main));
|
||||
getcontext(&main->context);
|
||||
main->id = main;
|
||||
main->status = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user