sched/task: fix Redundant memory allocation.

Since the task and group structures are no longer allocated in the same space, the memory for group is allocated in the group_allocate() function, and no further allocation is needed during the task allocation process.

Signed-off-by: wangzhi16 <wangzhi16@xiaomi.com>
This commit is contained in:
wangzhi16 2025-12-30 19:58:12 +08:00 committed by Alan C. Assis
parent db0b8c59ac
commit ea180792a3
2 changed files with 2 additions and 2 deletions

View file

@ -31,7 +31,7 @@ Here is the body of some function. It expects to have the following inputs:
* used to that all fields of the new TCB will be zeroed.
*/
tcb = kmm_zalloc(sizeof(struct tcb_s) + sizeof(struct task_group_s));
tcb = kmm_zalloc(sizeof(struct tcb_s));
if (tcb == NULL)
{
return -ENOMEM;

View file

@ -137,7 +137,7 @@ FAR struct tcb_s *nxtask_setup_fork(start_t retaddr)
/* Allocate a TCB for the child task. */
child = kmm_zalloc(sizeof(struct tcb_s) + sizeof(struct task_group_s));
child = kmm_zalloc(sizeof(struct tcb_s));
if (!child)
{
serr("ERROR: Failed to allocate TCB\n");