On Tue, 22 Dec 2009, torbenh wrote:

> class Ramp
> {
>    private:
>       float _phase;
>       float _omega;
>    public:
>       Ramp();
>       float process()
>       {
>           _phase += _omega;
>           return  _phase;
>       }
> };

Is the problem that _phase and _omega get reloaded from 
memory every time they're used?

Would it not work to declare process() as:

     float process() __restrict
     { ... }

Thus telling the compiler that `this` is not an alias when 
process() is called.

Or perhaps:

> int process( jack_nframes_t nframes, void *arg )
> {
>    int i;
>
>    float * __restrict__ buf = (float *) jack_port_get_buffer( out_port, 
> nframes );

      Ramp * __restrict__ o = &osc_block;

>
>    for( i=0; i<nframes; i++ ) {
>       buf[i] = osc_block.process();

Change to:
         buf[i] = o->process();

-gabriel

_______________________________________________
Linux-audio-dev mailing list
[email protected]
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev

Reply via email to