Skip to content

Commit 5354ccc

Browse files
committed
Tools: Testbench: Use calloc() instead of rzalloc() file file comp
This change avoids the heap usage of file component to impact the reported heap consumption numbers. The allocations of file component do not need to be done via the SOF framework. Signed-off-by: Seppo Ingalsuo <seppo.ingalsuo@linux.intel.com>
1 parent e345a43 commit 5354ccc

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

tools/testbench/file.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ static int file_init_set_dai_data(struct processing_module *mod)
534534
struct dai_data *dd;
535535
struct copier_data *ccd = module_get_private_data(mod);
536536

537-
dd = rzalloc(SOF_MEM_FLAG_USER, sizeof(*dd));
537+
dd = calloc(1, sizeof(*dd));
538538
if (!dd)
539539
return -ENOMEM;
540540

@@ -559,7 +559,7 @@ static int file_init_set_dai_data(struct processing_module *mod)
559559
struct dai_data *dd;
560560
struct comp_dev *dev = mod->dev;
561561

562-
dd = rzalloc(SOF_MEM_FLAG_USER, sizeof(*dd));
562+
dd = calloc(1, sizeof(*dd));
563563
if (!dd)
564564
return -ENOMEM;
565565

@@ -601,14 +601,14 @@ static int file_init(struct processing_module *mod)
601601

602602
tb_debug_print("file_init()\n");
603603

604-
ccd = rzalloc(SOF_MEM_FLAG_USER, sizeof(*ccd));
604+
ccd = calloc(1, sizeof(*ccd));
605605
if (!ccd)
606606
return -ENOMEM;
607607

608608
mod_data->private = ccd;
609609

610610
/* File component data is placed to copier's ipcgtw_data */
611-
cd = rzalloc(SOF_MEM_FLAG_USER, sizeof(*cd));
611+
cd = calloc(1, sizeof(*cd));
612612
if (!cd) {
613613
free(ccd);
614614
return -ENOMEM;

0 commit comments

Comments
 (0)