[quagga-dev 6583] Re: bgp_aspatch.c: aspath_make_str_count()

Jeremy Jackson jerj at coplanar.net
Mon May 11 13:35:04 BST 2009


On Mon, 2009-05-11 at 07:19 +0000, Chris Caputo wrote:
> For the aspath_make_str_count function, do you all like the static 
> buffer/exact strdup() method of below?  Or should we use this earlier 
> patch I sent against my own patch which is now in the tree:
> 
>   http://lists.quagga.net/pipermail/quagga-dev/2009-April/006541.html
> 
>   - (Fix egregious realloc() while in while loop inefficiency.  This code 
>     has been running on my two production routers since 4/30.)
> 
> Or?
> 
> I like the below but the downside is that it is not thread-safe.  Is that 
> a concern long term?

In the back of my mind I see migrating to pthreads so that would be a
step backwards.  How big a buffer are we talking?  What's the best
practice WRT putting on stack?  It's the fastest dynamic memory
allocation you will find, and also avoids malloc() fragmentation.

-- 
Jeremy Jackson
Coplanar Networks
(519)489-4903
http://www.coplanar.net
jerj at coplanar.net




More information about the Quagga-dev mailing list