[refactor] Organize STRING

This commit is contained in:
2026-06-05 18:38:45 +08:00
Unverified
parent da03b301fb
commit 9ee88ef7b9
19 changed files with 124 additions and 51 deletions
+1 -6
View File
@@ -53,12 +53,7 @@ task_t* task_create(const char* name, void (*entry)(void)) {
task->time_slice = TIME_SLICE_DEFAULT;
// Copy name
const char* s = name;
char* d = task->name;
for (SSINT32 i = 0; i < TASK_NAME_LEN - 1 && *s; i++) {
*d++ = *s++;
}
*d = '\0';
str_copy(task->name, name, TASK_NAME_LEN);
// Set up initial stack for first context_switch into this task.
// Stack grows downward. context_switch will pop 6 regs then ret.