Optimize session connection and buddy.

This commit is contained in:
TXuian
2024-04-24 14:31:00 +08:00
parent fc380de895
commit 213a92330e
8 changed files with 62 additions and 7 deletions

View File

@@ -49,6 +49,7 @@ static void _task_manager_init()
}
// init task (slab) allocator
slab_init(&xizi_task_manager.task_allocator, sizeof(struct TaskMicroDescriptor));
slab_init(&xizi_task_manager.task_buddy_allocator, sizeof(struct KBuddy));
// pid pool
xizi_task_manager.next_pid = 0;
@@ -95,6 +96,10 @@ static void _dealloc_task_cb(struct TaskMicroDescriptor* task)
doubleListDel(cur_node);
// free task back to allocator
if (task->massive_ipc_allocator != NULL) {
KBuddyDestory(task->massive_ipc_allocator);
slab_free(&xizi_task_manager.task_buddy_allocator, (void*)task->massive_ipc_allocator);
}
slab_free(&xizi_task_manager.task_allocator, (void*)task);
// remove priority