Module: sip-router Branch: master Commit: 346a9a0551e546189048d379ebe1f630db910d7c URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=346a9a05...
Author: Jan Janak jan@iptel.org Committer: Jan Janak jan@iptel.org Date: Tue Mar 31 02:47:44 2009 +0200
Shared memory versions of mk_proxy and free_proxy.
This patch adds function mk_shm_proxy, which is the shared memory version of function mk_proxy. In addition to that it adds function free_shm_proxy which is the shared memory version of free_proxy.
To avoid code duplication, we turned the body of the original hostent_cpy function into macro called HOSTENT_CPY, the macro takes malloc and free functions as parameters. The macro is then called in the body of hostent_cpy with pkg_malloc and pkg_free as parameters and in the body of hostent_shm_cpy with shm_malloc and shm_free as parameters.
We did the same to mk_proxy function. The original body of the function was converted into macro MK_PROXY which, again, takes memory allocation functions as we all the hostent copy function as parameters.
---
proxy.c | 284 ++++++++++++++++++++++++++++++++++++-------------------------- proxy.h | 2 + 2 files changed, 167 insertions(+), 119 deletions(-)
Diff: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commitdiff;h=346a...