feat: reduce memset size

This commit is contained in:
Alessandre Laguierce 2025-03-24 09:12:41 +01:00
parent 9f8e7740e4
commit bf8e6e9d0d

View File

@ -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;