diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-07-03 15:19:31 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-07-03 15:19:31 +0000 |
commit | ed98898bb501d02e69093d34961bf1fb46d2ed4d (patch) | |
tree | e068af64b6db7985a173fe39a7559356608c108d /pjlib/include | |
parent | 63147d55f091ec8ba1a5b57cb04b421938ec9fde (diff) |
Change all pj_memset to pj_bzero(), where applicable
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@582 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/include')
-rw-r--r-- | pjlib/include/pj/compat/cc_gcc.h | 5 | ||||
-rw-r--r-- | pjlib/include/pj/pool_i.h | 2 | ||||
-rw-r--r-- | pjlib/include/pj/string.h | 4 |
3 files changed, 10 insertions, 1 deletions
diff --git a/pjlib/include/pj/compat/cc_gcc.h b/pjlib/include/pj/compat/cc_gcc.h index 11dfd81e..46b6afc0 100644 --- a/pjlib/include/pj/compat/cc_gcc.h +++ b/pjlib/include/pj/compat/cc_gcc.h @@ -49,5 +49,10 @@ typedef unsigned long long pj_uint64_t; #define PJ_INT64_FMT "L" +#ifdef __GLIBC__ +# define PJ_HAS_BZERO 1 +#endif + + #endif /* __PJ_COMPAT_CC_GCC_H__ */ diff --git a/pjlib/include/pj/pool_i.h b/pjlib/include/pj/pool_i.h index 05db29b7..3df6b97f 100644 --- a/pjlib/include/pj/pool_i.h +++ b/pjlib/include/pj/pool_i.h @@ -68,7 +68,7 @@ PJ_IDEF(void*) pj_pool_calloc( pj_pool_t *pool, pj_size_t count, pj_size_t size) { void *buf = pj_pool_alloc( pool, size*count); if (buf) - pj_memset(buf, 0, size * count); + pj_bzero(buf, size * count); return buf; } diff --git a/pjlib/include/pj/string.h b/pjlib/include/pj/string.h index 7c513e7c..4466567e 100644 --- a/pjlib/include/pj/string.h +++ b/pjlib/include/pj/string.h @@ -552,7 +552,11 @@ PJ_DECL(int) pj_utoa_pad( unsigned long val, char *buf, int min_dig, int pad); */ PJ_INLINE(void) pj_bzero(void *dst, pj_size_t size) { +#if defined(PJ_HAS_BZERO) && PJ_HAS_BZERO!=0 bzero(dst, size); +#else + memset(dst, 0, size); +#endif } |