bugfix: do not allocate memory
Memory was allocated which was "lost" because the address of the block was put in a pointer that is overwritten just after. Discussing with Elena, the current commit is the correct way to do things.
This commit is contained in:
@@ -119,8 +119,9 @@ void fill_channel_desc(channel_desc_t *chan_desc,
|
||||
else {
|
||||
chan_desc->R_sqrt = (struct complex**) calloc(nb_taps,sizeof(struct complex*));
|
||||
for (i = 0; i<nb_taps; i++) {
|
||||
chan_desc->R_sqrt[i] = (struct complex*) calloc(nb_tx*nb_rx*nb_tx*nb_rx,sizeof(struct complex));
|
||||
//chan_desc->R_sqrt[i] = (struct complex*) calloc(nb_tx*nb_rx*nb_tx*nb_rx,sizeof(struct complex));
|
||||
//chan_desc->R_sqrt = (struct complex*)&R_sqrt[i][0];
|
||||
/* all chan_desc share the same R_sqrt, coming from caller */
|
||||
chan_desc->R_sqrt[i] = R_sqrt[0];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user