aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2009-03-31 21:32:18 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2009-03-31 21:32:18 +0000
commit4c8c4ee7889574716ab9bbb13f021c76fdd255fa (patch)
treea47f275f73af6c58e5789dadfb38ec3ac4e29a9c
parent1c24f1a04a521649bd4ba75970c32563c79cd1bc (diff)
Blocked revisions 185581 via svnmerge
........ r185581 | kpfleming | 2009-03-31 16:29:50 -0500 (Tue, 31 Mar 2009) | 19 lines Optimizations to the stringfields API This patch provides a number of optimizations to the stringfields API, focused around saving (not wasting) memory whenever possible. Thanks to Mark Michelson for inspiring this work and coming up with the first two optimizations that are represented here: Changes: - Cleanup of some code, fix incorrect doxygen comments - When a field is emptied or replaced with a new allocation, decrease the amount of 'active' space in the pool it was held in; if that pool reaches zero active space, and is not the current pool, then free it as it is no longer in use - When allocating a pool, try to allocate a size that will fit in a 'standard' malloc() allocation without wasting space - When allocating space for a field, store the amount of space in the two bytes immediately preceding the field; this eliminates the need to call strlen() on the field when overwriting it, and more importantly it 'remembers' the amount of space the field has available, even if a shorter string has been stored in it since it was allocated - Don't automatically double the size of each successive pool allocated; it's wasteful http://reviewboard.digium.com/r/165/ ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.1@185593 f38db490-d61c-443f-a65b-d21fe96a405b
0 files changed, 0 insertions, 0 deletions