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.


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.0@129735 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.6.0
Mark Michelson 17 years ago
parent f6f918d6a6
commit 7ac7889760

Diff Content Not Available