Changeset a9a8c04


Ignore:
Timestamp:
Jan 29, 2019, 3:30:23 AM (5 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/crepe_org
Children:
9498c88
Parents:
64959c4
Message:

[fmat] clarify memory allocation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/fmat.c

    r64959c4 ra9a8c04  
    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.