[asterisk-commits] anthonyl: branch anthonyl/indication-sf r46710 -
in /team/anthonyl/indication...
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Tue Oct 31 13:50:27 MST 2006
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
More information about the asterisk-commits
mailing list