On Sat, Mar 3, 2012 at 12:57 AM, Thomas Grill <g...@grrrr.org> wrote:
>>
>>
>> How about function call overhead? For constructor and destructor no
>> problem of course, but accessor wrappers will be called often, in fact
>> it doubles the number of function calls for external access.
>>
>
> I would not worry about that too much. The potential number-crunching 
> happening in your routines will most probably outweigh that small member 
> calling overhead.
> If your methods are real lightweight (and they are defined in an included - 
> not a linked - file) you can still rely on a decent compiler to inline them, 
> bashing overhead to zero.


I fail to see how those C wrappers could be inlined. Wouldn't that
undo their raison d'ĂȘtre (replacing a C++ call with a C call)? But
indeed function call overhead is small when compared to
number-crunching, if these calls are done per block and not per
sample.

So it could be done like this: write a lib in C++ with C++ API, and
additionally provide C wrappers for the API functions. Then it's up to
the application programmer to use the C wrappers or call C++ functions
directly. That seems convenient, apart from other issues as mentioned
by Hans and Mathieu.


Katja

_______________________________________________
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list

Reply via email to