Changeset 668dfdd


Ignore:
Timestamp:
Dec 29, 2021, 5:52:02 PM (2 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/crepe
Children:
75e0b81
Parents:
5a4b6c5
git-author:
Paul Brossier <piem@piem.org> (01/29/19 03:30:23)
git-committer:
Paul Brossier <piem@piem.org> (12/29/21 17:52:02)
Message:

[fmat] clarify memory allocation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/fmat.c

    r5a4b6c5 r668dfdd  
    2525  fmat_t * s;
    2626  uint_t i;
    27   if ((sint_t)length <= 0 || (sint_t)height <= 0 ) {
     27  if ((sint_t)height <= 0 || (sint_t)length <= 0 ) {
    2828    return NULL;
    2929  }
     
    3131  s->height = height;
    3232  s->length = length;
     33  // array of row pointers
    3334  s->data = AUBIO_ARRAY(smpl_t*,s->height);
    34   s->data[0] = AUBIO_ARRAY(smpl_t, s->length * s->height);
     35  // first row store the full height * length buffer
     36  s->data[0] = AUBIO_ARRAY(smpl_t, s->height * s->length);
    3537  for (i=1; i< s->height; i++) {
    3638    s->data[i] = s->data[0] + i * s->length;
Note: See TracChangeset for help on using the changeset viewer.