mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
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:
parent
db0b8c59ac
commit
ea180792a3
2 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue