[Asterisk-Dev] timeval stuff

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Thu Jun 9 08:43:00 MST 2005


On Thursday 09 June 2005 10:22, Kevin P. Fleming wrote:
> Luigi Rizzo wrote:
> > compared to the use of pointers, there is an extra copy of 64-bit
> > values, however 1) on modern machines that cost is probably
> > negligible, and 2) these things are generally associated to more
> > expensive computations, such as system calls etc. so i would not
> > worry.
>
> I like this idea (in fact I'm about to pull the ms_diff function out
> of app_alarmreceiver.c and into utils.h so I can use it in some other
> code). However, I think we need to stick with passing struct pointers
> around whenever we can, unless it's really ugly.

Well, the only problem with passing struct pointers around is that you
need to preallocate the memory, which adds several lines to the code.
I think that's part of the advantage of Luigi's suggestion.

-- 
Tilghman



More information about the asterisk-dev mailing list