[asterisk-commits] mmichelson: branch 1.6.0 r129735 - /branches/1.6.0/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jul 10 15:34:13 CDT 2008


Author: mmichelson
Date: Thu Jul 10 15:34:12 2008
New Revision: 129735

URL: http://svn.digium.com/view/asterisk?view=rev&rev=129735
Log:
Blocked revisions 129734 via svnmerge

........
r129734 | mmichelson | 2008-07-10 15:33:13 -0500 (Thu, 10 Jul 2008) | 23 lines

Removed the fn2 field from the vm_state structure.

fn2 was used in three functions. In every case, it was initialized
in the function it was used in. This meant there was no need
to have it in a malloc'd structure just taking up space. Furthermore
two of the functions it was used in were completely unnecessary since
fn2 was set to exactly the same value as the vm_state's fn string.

fn2 was a char array sized at PATH_MAX. On my system, PATH_MAX is 
4096. This equates to a 4K memory savings per vm_state allocated. 
Since there is a vm_state malloc'd for every voicemail user on 
the system, this could potentially add up nicely if there are lots 
of users. In addition, a vm_state is allocated on the stack each 
time a caller calls the VoiceMailMain application, meaning that 
there is a significant stack savings with this patch too.

Of course, a single vm_state struct still takes up approximately
20K on my system (when using IMAP storage. Without IMAP storage,
there would be about another 300 bytes fewer usage), even with 
this removal. Further optimizations are probably possible, 
but most likely not as easy as this one.


........

Modified:
    branches/1.6.0/   (props changed)

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-blocked' - no diff available.




More information about the asterisk-commits mailing list