[prev in list] [next in list] [prev in thread] [next in thread] 

List:       asterisk-commits
Subject:    [asterisk-commits] anthonyl: branch anthonyl/indication-sf r46710 -
From:       asterisk-commits () lists ! digium ! com (asterisk-commits () lists ! digium ! com)
Date:       2006-10-31 13:50:23
Message-ID: 20061031205028.15FE5A93B76 () abita ! digium ! internal
[Download RAW message or body]

Author: anthonyl
Date: Tue Oct 31 14:50:27 2006
New Revision: 46710

URL: http://svn.digium.com/view/asterisk?rev=46710&view=rev
Log:
60% less memory usage in the indications code

Modified:
    team/anthonyl/indication-sf/main/indications.c
    team/anthonyl/indication-sf/res/res_indications.c

Modified: team/anthonyl/indication-sf/main/indications.c
URL: http://svn.digium.com/view/asterisk/team/anthonyl/indication-sf/main/indications.c?rev=46710&r1=46709&r2=46710&view=diff
 ==============================================================================
--- team/anthonyl/indication-sf/main/indications.c (original)
+++ team/anthonyl/indication-sf/main/indications.c Tue Oct 31 14:50:27 2006
@@ -551,9 +551,9 @@
 		ts->next = NULL;
 	}
 
-	ast_string_field_set(ts,data,indication);
-	ast_string_field_set(ts,data,tonelist);
-
+	ast_string_field_build(ts,data,"%s",indication);
+	ast_string_field_build(ts,data,"%s",tonelist);
+		
 	if (ps)
 		ps->next = ts;
 	else

Modified: team/anthonyl/indication-sf/res/res_indications.c
URL: http://svn.digium.com/view/asterisk/team/anthonyl/indication-sf/res/res_indications.c?rev=46710&r1=46709&r2=46710&view=diff
 ==============================================================================
--- team/anthonyl/indication-sf/res/res_indications.c (original)
+++ team/anthonyl/indication-sf/res/res_indications.c Tue Oct 31 14:50:27 2006
@@ -313,12 +313,16 @@
 					ast_config_destroy(cfg);
 					return -1;
 				}
+				if (ast_string_field_init(ts,256)) {
+					ast_log(LOG_WARNING,"string_field_init() failed\n");
+					return 0;
+				}
+				
 				ts->next = NULL;
-
-				ast_string_field_set(ts,name,v->name);
-				ast_string_field_set(ts,data,v->value);
+				ast_string_field_build(ts,name,"%s",v->name);
+				ast_string_field_build(ts,data,"%s",v->value);
 				
-				
+								
 				if (ps)
 					ps->next = ts;
 				else


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic