]> granicus.if.org Git - transmission/commitdiff
(trunk libT) instead of growing the ptrArray by a constant fixed amount when it runs...
authorCharles Kerr <charles@transmissionbt.com>
Mon, 15 Feb 2010 16:44:02 +0000 (16:44 +0000)
committerCharles Kerr <charles@transmissionbt.com>
Mon, 15 Feb 2010 16:44:02 +0000 (16:44 +0000)
libtransmission/ptrarray.c

index a4b07bf9c1c44f54ff71e9a22691b26e55439426..418edd96206d1d911d0e8f2b57562af175b853fc 100644 (file)
@@ -17,7 +17,7 @@
 #include "ptrarray.h"
 #include "utils.h"
 
-#define GROW 32
+#define FLOOR 32
 
 const tr_ptrArray TR_PTR_ARRAY_INIT = { NULL, 0, 0 };
 
@@ -78,7 +78,7 @@ tr_ptrArrayInsert( tr_ptrArray * t,
 
     if( t->n_items >= t->n_alloc )
     {
-        t->n_alloc = t->n_items + GROW;
+        t->n_alloc = MAX( FLOOR, t->n_alloc * 2 );
         t->items = tr_renew( void*, t->items, t->n_alloc );
     }