On Thu, Jun 8, 2017 at 1:14 PM, Stéphane Letz <l...@grame.fr> wrote:

> The reason is that we want to share a unique table between all instances
> of the class. But… it appears that:
>
> - even if the table is shared, the classInit code is actually called each
> time in the instance::init(SR) method, which is rather stupid…((-; and
> possibly problematic.
>
>
Wouldn't something like this work?

static float *ftbl0mydspSIG0;

class MyDSP : public dsp {

  static void classInit(int samplingFreq) {
     lock_mutex();

     if (ftbl0mydspSIG0==NULL){
        ftbl0mydspSIG0 = malloc(sizeof(float)*65537);
        ...
     }

     unlock_mutex();
  }
}
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Faudiostream-devel mailing list
Faudiostream-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-devel

Reply via email to