[svn-commits] dvossel: branch dvossel/fixtheworld_phase1_step2 r299577 - /team/dvossel/fixt...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Dec 23 16:02:02 UTC 2010


Author: dvossel
Date: Thu Dec 23 10:01:58 2010
New Revision: 299577

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=299577
Log:
Increase the default size of the translator matrix

Modified:
    team/dvossel/fixtheworld_phase1_step2/main/translate.c

Modified: team/dvossel/fixtheworld_phase1_step2/main/translate.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step2/main/translate.c?view=diff&rev=299577&r1=299576&r2=299577
==============================================================================
--- team/dvossel/fixtheworld_phase1_step2/main/translate.c (original)
+++ team/dvossel/fixtheworld_phase1_step2/main/translate.c Thu Dec 23 10:01:58 2010
@@ -82,9 +82,9 @@
 static ast_rwlock_t tablelock;
 
 /* index size starts at this*/
-#define INIT_INDEX 24
+#define INIT_INDEX 32
 /* index size grows by this as necessary */
-#define GROW_INDEX 8
+#define GROW_INDEX 16
 
 /*! the current largest index used by the matrix_get( and __indextable tables */
 static int cur_max_index;
@@ -988,7 +988,10 @@
 	char tmp[80];
 
 	if (add_format2index(t->srcfmt) || add_format2index(t->dstfmt)) {
-		matrix_resize(0);
+		if (matrix_resize(0)) {
+			ast_log(LOG_WARNING, "Translator matrix can not represent any more translators.  Out of resources.\n");
+			return -1;
+		}
 		add_format2index(t->srcfmt);
 		add_format2index(t->dstfmt);
 	}




More information about the svn-commits mailing list