Index: pjproject/trunk/pjlib-util/src/pjlib-util-test/xml.c
===================================================================
--- pjproject/trunk/pjlib-util/src/pjlib-util-test/xml.c	(revision 581)
+++ pjproject/trunk/pjlib-util/src/pjlib-util-test/xml.c	(revision 582)
@@ -111,6 +111,5 @@
     }
 
-    output = (char*)pj_pool_alloc(pool, msg.slen + 512);
-    pj_memset(output, 0, msg.slen+512);
+    output = (char*)pj_pool_zalloc(pool, msg.slen + 512);
     output_len = pj_xml_print(root, output, msg.slen+512, PJ_TRUE);
     if (output_len < 1) {
Index: pjproject/trunk/pjlib-util/src/pjlib-util/md5.c
===================================================================
--- pjproject/trunk/pjlib-util/src/pjlib-util/md5.c	(revision 581)
+++ pjproject/trunk/pjlib-util/src/pjlib-util/md5.c	(revision 582)
@@ -152,13 +152,13 @@
     if (count < 8) {
 	/* Two lots of padding:  Pad the first block to 64 bytes */
-	pj_memset(p, 0, count);
+	pj_bzero(p, count);
 	byteReverse(ctx->in, 16);
 	MD5Transform(ctx->buf, (pj_uint32_t *) ctx->in);
 
 	/* Now fill the next block with 56 bytes */
-	pj_memset(ctx->in, 0, 56);
+	pj_bzero(ctx->in, 56);
     } else {
 	/* Pad block to 56 bytes */
-	pj_memset(p, 0, count - 8);
+	pj_bzero(p, count - 8);
     }
     byteReverse(ctx->in, 14);
@@ -171,5 +171,5 @@
     byteReverse((unsigned char *) ctx->buf, 4);
     pj_memcpy(digest, ctx->buf, 16);
-    pj_memset(ctx, 0, sizeof(ctx));	/* In case it's sensitive */
+    pj_bzero(ctx, sizeof(ctx));	/* In case it's sensitive */
 }
 
Index: pjproject/trunk/pjlib-util/src/pjlib-util/scanner_cis_bitwise.c
===================================================================
--- pjproject/trunk/pjlib-util/src/pjlib-util/scanner_cis_bitwise.c	(revision 581)
+++ pjproject/trunk/pjlib-util/src/pjlib-util/scanner_cis_bitwise.c	(revision 582)
@@ -25,5 +25,5 @@
 PJ_DEF(void) pj_cis_buf_init( pj_cis_buf_t *cis_buf)
 {
-    pj_memset(cis_buf->cis_buf, 0, sizeof(cis_buf->cis_buf));
+    pj_bzero(cis_buf->cis_buf, sizeof(cis_buf->cis_buf));
     cis_buf->use_mask = 0;
 }
Index: pjproject/trunk/pjlib-util/src/pjlib-util/scanner_cis_uint.c
===================================================================
--- pjproject/trunk/pjlib-util/src/pjlib-util/scanner_cis_uint.c	(revision 581)
+++ pjproject/trunk/pjlib-util/src/pjlib-util/scanner_cis_uint.c	(revision 582)
@@ -31,5 +31,5 @@
 PJ_DEF(pj_status_t) pj_cis_init(pj_cis_buf_t *cis_buf, pj_cis_t *cis)
 {
-    pj_memset(cis->cis_buf, 0, sizeof(cis->cis_buf));
+    pj_bzero(cis->cis_buf, sizeof(cis->cis_buf));
     return PJ_SUCCESS;
 }
Index: pjproject/trunk/pjlib/include/pj/compat/cc_gcc.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/compat/cc_gcc.h	(revision 581)
+++ pjproject/trunk/pjlib/include/pj/compat/cc_gcc.h	(revision 582)
@@ -50,4 +50,9 @@
 
 
+#ifdef __GLIBC__
+#   define PJ_HAS_BZERO		1
+#endif
+
+
 #endif	/* __PJ_COMPAT_CC_GCC_H__ */
 
Index: pjproject/trunk/pjlib/include/pj/pool_i.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/pool_i.h	(revision 581)
+++ pjproject/trunk/pjlib/include/pj/pool_i.h	(revision 582)
@@ -69,5 +69,5 @@
     void *buf = pj_pool_alloc( pool, size*count);
     if (buf)
-	pj_memset(buf, 0, size * count);
+	pj_bzero(buf, size * count);
     return buf;
 }
Index: pjproject/trunk/pjlib/include/pj/string.h
===================================================================
--- pjproject/trunk/pjlib/include/pj/string.h	(revision 581)
+++ pjproject/trunk/pjlib/include/pj/string.h	(revision 582)
@@ -553,5 +553,9 @@
 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
 }
 
Index: pjproject/trunk/pjlib/src/pj/file_access_win32.c
===================================================================
--- pjproject/trunk/pjlib/src/pj/file_access_win32.c	(revision 581)
+++ pjproject/trunk/pjlib/src/pj/file_access_win32.c	(revision 582)
@@ -143,5 +143,5 @@
     //    return PJ_RETURN_OS_ERROR(GetLastError());
 
-    pj_memset(&pt, 0, sizeof(pt));
+    pj_bzero(&pt, sizeof(pt));
     pt.year = localTime.wYear;
     pt.mon = localTime.wMonth-1;
Index: pjproject/trunk/pjlib/src/pj/ioqueue_common_abs.c
===================================================================
--- pjproject/trunk/pjlib/src/pj/ioqueue_common_abs.c	(revision 581)
+++ pjproject/trunk/pjlib/src/pj/ioqueue_common_abs.c	(revision 582)
@@ -998,5 +998,5 @@
 				     pj_size_t size )
 {
-    pj_memset(op_key, 0, size);
+    pj_bzero(op_key, size);
 }
 
Index: pjproject/trunk/pjlib/src/pj/ioqueue_winnt.c
===================================================================
--- pjproject/trunk/pjlib/src/pj/ioqueue_winnt.c	(revision 581)
+++ pjproject/trunk/pjlib/src/pj/ioqueue_winnt.c	(revision 582)
@@ -178,6 +178,6 @@
         pj_memcpy(accept_overlapped->remote, remote, locallen);
     } else {
-        pj_memset(accept_overlapped->local, 0, *accept_overlapped->addrlen);
-        pj_memset(accept_overlapped->remote, 0, *accept_overlapped->addrlen);
+        pj_bzero(accept_overlapped->local, *accept_overlapped->addrlen);
+        pj_bzero(accept_overlapped->remote, *accept_overlapped->addrlen);
     }
     *accept_overlapped->addrlen = locallen;
@@ -834,5 +834,5 @@
      * Register overlapped Recv() operation.
      */
-    pj_memset(&op_key_rec->overlapped.overlapped, 0,
+    pj_bzero( &op_key_rec->overlapped.overlapped, 
               sizeof(op_key_rec->overlapped.overlapped));
     op_key_rec->overlapped.operation = PJ_IOQUEUE_OP_RECV;
@@ -910,5 +910,5 @@
      * Register overlapped Recv() operation.
      */
-    pj_memset(&op_key_rec->overlapped.overlapped, 0,
+    pj_bzero( &op_key_rec->overlapped.overlapped, 
               sizeof(op_key_rec->overlapped.overlapped));
     op_key_rec->overlapped.operation = PJ_IOQUEUE_OP_RECV;
@@ -1003,5 +1003,5 @@
      * Schedule asynchronous WSASend().
      */
-    pj_memset(&op_key_rec->overlapped.overlapped, 0,
+    pj_bzero( &op_key_rec->overlapped.overlapped, 
               sizeof(op_key_rec->overlapped.overlapped));
     op_key_rec->overlapped.operation = PJ_IOQUEUE_OP_SEND;
@@ -1100,5 +1100,5 @@
     op_key_rec->accept.remote = remote;
     op_key_rec->accept.newsock_ptr = new_sock;
-    pj_memset(&op_key_rec->accept.overlapped, 0, 
+    pj_bzero( &op_key_rec->accept.overlapped, 
 	      sizeof(op_key_rec->accept.overlapped));
 
@@ -1207,5 +1207,5 @@
 				     pj_size_t size )
 {
-    pj_memset(op_key, 0, size);
+    pj_bzero(op_key, size);
 }
 
Index: pjproject/trunk/pjlib/src/pj/os_core_linux_kernel.c
===================================================================
--- pjproject/trunk/pjlib/src/pj/os_core_linux_kernel.c	(revision 581)
+++ pjproject/trunk/pjlib/src/pj/os_core_linux_kernel.c	(revision 582)
@@ -262,5 +262,5 @@
 
     /* Initialize and set the thread entry. */
-    pj_memset(desc, 0, sizeof(struct pj_thread_t));
+    pj_bzero(desc, sizeof(struct pj_thread_t));
 
     if(cstr_thread_name && pj_strlen(&thread_name) < sizeof(thread->obj_name)-1)
Index: pjproject/trunk/pjlib/src/pj/os_core_unix.c
===================================================================
--- pjproject/trunk/pjlib/src/pj/os_core_unix.c	(revision 581)
+++ pjproject/trunk/pjlib/src/pj/os_core_unix.c	(revision 582)
@@ -207,5 +207,5 @@
 
     /* Initialize and set the thread entry. */
-    pj_memset(desc, 0, sizeof(struct pj_thread_t));
+    pj_bzero(desc, sizeof(struct pj_thread_t));
     thread->thread = pthread_self();
 
Index: pjproject/trunk/pjlib/src/pj/os_core_win32.c
===================================================================
--- pjproject/trunk/pjlib/src/pj/os_core_win32.c	(revision 581)
+++ pjproject/trunk/pjlib/src/pj/os_core_win32.c	(revision 582)
@@ -216,5 +216,5 @@
 
     /* Initialize and set the thread entry. */
-    pj_memset(desc, 0, sizeof(struct pj_thread_t));
+    pj_bzero(desc, sizeof(struct pj_thread_t));
     thread->hthread = GetCurrentThread();
     thread->idthread = GetCurrentThreadId();
Index: pjproject/trunk/pjlib/src/pj/os_time_win32.c
===================================================================
--- pjproject/trunk/pjlib/src/pj/os_time_win32.c	(revision 581)
+++ pjproject/trunk/pjlib/src/pj/os_time_win32.c	(revision 582)
@@ -103,5 +103,5 @@
     LARGE_INTEGER li;
 
-    pj_memset(&st, 0, sizeof(st));
+    pj_bzero(&st, sizeof(st));
     st.wYear = (pj_uint16_t) pt->year;
     st.wMonth = (pj_uint16_t) (pt->mon + 1);
Index: pjproject/trunk/pjlib/src/pj/pool.c
===================================================================
--- pjproject/trunk/pjlib/src/pj/pool.c	(revision 581)
+++ pjproject/trunk/pjlib/src/pj/pool.c	(revision 582)
@@ -185,5 +185,5 @@
     /* Set pool administrative data. */
     pool = (pj_pool_t*)buffer;
-    pj_memset(pool, 0, sizeof(*pool));
+    pj_bzero(pool, sizeof(*pool));
 
     pj_list_init(&pool->block_list);
Index: pjproject/trunk/pjlib/src/pj/pool_caching.c
===================================================================
--- pjproject/trunk/pjlib/src/pj/pool_caching.c	(revision 581)
+++ pjproject/trunk/pjlib/src/pj/pool_caching.c	(revision 582)
@@ -48,5 +48,5 @@
     PJ_CHECK_STACK();
 
-    pj_memset(cp, 0, sizeof(*cp));
+    pj_bzero(cp, sizeof(*cp));
     
     cp->max_capacity = max_capacity;
Index: pjproject/trunk/pjlib/src/pj/pool_dbg.c
===================================================================
--- pjproject/trunk/pjlib/src/pj/pool_dbg.c	(revision 581)
+++ pjproject/trunk/pjlib/src/pj/pool_dbg.c	(revision 582)
@@ -177,5 +177,5 @@
 	return NULL;
 
-    pj_memset(mem, 0, cnt*elemsz);
+    pj_bzero(mem, cnt*elemsz);
     return mem;
 }
Index: pjproject/trunk/pjlib/src/pj/sock_bsd.c
===================================================================
--- pjproject/trunk/pjlib/src/pj/sock_bsd.c	(revision 581)
+++ pjproject/trunk/pjlib/src/pj/sock_bsd.c	(revision 582)
@@ -211,5 +211,5 @@
     RESET_LEN(addr);
     addr->sin_family = AF_INET;
-    pj_memset(addr->sin_zero, 0, sizeof(addr->sin_zero));
+    pj_bzero(addr->sin_zero, sizeof(addr->sin_zero));
 
     if (str_addr && str_addr->slen) {
@@ -249,5 +249,5 @@
     RESET_LEN(addr);
     addr->sin_family = PJ_AF_INET;
-    pj_memset(addr->sin_zero, 0, sizeof(addr->sin_zero));
+    pj_bzero(addr->sin_zero, sizeof(addr->sin_zero));
     pj_sockaddr_in_set_port(addr, port);
     return pj_sockaddr_in_set_str_addr(addr, str_addr);
@@ -371,5 +371,5 @@
     SET_LEN(&addr, sizeof(pj_sockaddr_in));
     addr.sin_family = PJ_AF_INET;
-    pj_memset(addr.sin_zero, 0, sizeof(addr.sin_zero));
+    pj_bzero(addr.sin_zero, sizeof(addr.sin_zero));
     addr.sin_addr.s_addr = pj_htonl(addr32);
     addr.sin_port = pj_htons(port);
Index: pjproject/trunk/pjlib/src/pjlib-test/ioq_udp.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/ioq_udp.c	(revision 581)
+++ pjproject/trunk/pjlib/src/pjlib-test/ioq_udp.c	(revision 582)
@@ -165,5 +165,5 @@
     // Bind server socket.
     TRACE_("bind socket...");
-    pj_memset(&addr, 0, sizeof(addr));
+    pj_bzero(&addr, sizeof(addr));
     addr.sin_family = PJ_AF_INET;
     addr.sin_port = pj_htons(PORT);
@@ -202,5 +202,5 @@
     // Register reading from ioqueue.
     TRACE_("start recvfrom...");
-    pj_memset(&addr, 0, sizeof(addr));
+    pj_bzero(&addr, sizeof(addr));
     addrlen = sizeof(addr);
     bytes = bufsize;
@@ -387,5 +387,5 @@
 
     /* Register rsock to ioqueue. */
-    pj_memset(&cb, 0, sizeof(cb));
+    pj_bzero(&cb, sizeof(cb));
     cb.on_read_complete = &on_read_complete;
     packet_cnt = 0;
@@ -618,5 +618,5 @@
 
     // Bind server socket.
-    pj_memset(&addr, 0, sizeof(addr));
+    pj_bzero(&addr, sizeof(addr));
     addr.sin_family = PJ_AF_INET;
     addr.sin_port = pj_htons(PORT);
@@ -639,5 +639,5 @@
     inactive_read_op = (pj_ioqueue_op_key_t*)pj_pool_alloc(pool,
                               inactive_sock_count*sizeof(pj_ioqueue_op_key_t));
-    pj_memset(&addr, 0, sizeof(addr));
+    pj_bzero(&addr, sizeof(addr));
     addr.sin_family = PJ_AF_INET;
     for (i=0; i<inactive_sock_count; ++i) {
Index: pjproject/trunk/pjlib/src/pjlib-test/ioq_unreg.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/ioq_unreg.c	(revision 581)
+++ pjproject/trunk/pjlib/src/pjlib-test/ioq_unreg.c	(revision 582)
@@ -166,5 +166,5 @@
 	}
 
-	pj_memset(&callback, 0, sizeof(callback));
+	pj_bzero(&callback, sizeof(callback));
 	status = pj_ioqueue_register_sock(test_pool, ioqueue, osd.sock,
 					  NULL, &callback, &osd.key);
@@ -227,5 +227,5 @@
 
     /* Register socket to ioqueue */
-    pj_memset(&callback, 0, sizeof(callback));
+    pj_bzero(&callback, sizeof(callback));
     callback.on_read_complete = &on_read_complete;
     status = pj_ioqueue_register_sock(sock_data.pool, ioqueue, sock_data.sock,
Index: pjproject/trunk/pjlib/src/pjlib-test/select.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/select.c	(revision 581)
+++ pjproject/trunk/pjlib/src/pjlib-test/select.c	(revision 582)
@@ -125,5 +125,5 @@
 
     // Bind one of the UDP socket.
-    pj_memset(&udp_addr, 0, sizeof(udp_addr));
+    pj_bzero(&udp_addr, sizeof(udp_addr));
     udp_addr.sin_family = PJ_AF_INET;
     udp_addr.sin_port = UDP_PORT;
Index: pjproject/trunk/pjlib/src/pjlib-test/sock.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/sock.c	(revision 581)
+++ pjproject/trunk/pjlib/src/pjlib-test/sock.c	(revision 582)
@@ -110,5 +110,5 @@
      */
     pj_sockaddr_in_init(&addr2, 0, 1000);
-    pj_memset(zero, 0, sizeof(zero));
+    pj_bzero(zero, sizeof(zero));
     if (pj_memcmp(addr2.sin_zero, zero, sizeof(addr2.sin_zero)) != 0)
 	return -35;
@@ -197,5 +197,5 @@
 	int srclen = sizeof(addr);
 	
-	pj_memset(&addr, 0, sizeof(addr));
+	pj_bzero(&addr, sizeof(addr));
 
         received = DATA_LEN;
@@ -335,5 +335,5 @@
 
     /* Bind server socket. */
-    pj_memset(&dstaddr, 0, sizeof(dstaddr));
+    pj_bzero(&dstaddr, sizeof(dstaddr));
     dstaddr.sin_family = PJ_AF_INET;
     dstaddr.sin_port = pj_htons(UDP_PORT);
@@ -346,5 +346,5 @@
 
     /* Bind client socket. */
-    pj_memset(&srcaddr, 0, sizeof(srcaddr));
+    pj_bzero(&srcaddr, sizeof(srcaddr));
     srcaddr.sin_family = PJ_AF_INET;
     srcaddr.sin_port = pj_htons(UDP_PORT-1);
Index: pjproject/trunk/pjlib/src/pjlib-test/udp_echo_srv_ioqueue.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/udp_echo_srv_ioqueue.c	(revision 581)
+++ pjproject/trunk/pjlib/src/pjlib-test/udp_echo_srv_ioqueue.c	(revision 582)
@@ -163,5 +163,5 @@
     pj_status_t rc;
 
-    pj_memset(&callback, 0, sizeof(callback));
+    pj_bzero(&callback, sizeof(callback));
     callback.on_read_complete = &on_read_complete;
     callback.on_write_complete = &on_write_complete;
Index: pjproject/trunk/pjlib/src/pjlib-test/util.c
===================================================================
--- pjproject/trunk/pjlib/src/pjlib-test/util.c	(revision 581)
+++ pjproject/trunk/pjlib/src/pjlib-test/util.c	(revision 582)
@@ -46,5 +46,5 @@
         return rc;
 
-    pj_memset(&addr, 0, sizeof(addr));
+    pj_bzero(&addr, sizeof(addr));
     addr.sin_family = (pj_uint16_t)family;
     addr.sin_port = (short)(port!=-1 ? pj_htons((pj_uint16_t)port) : 0);
@@ -86,5 +86,5 @@
 
     /* Retry bind */
-    pj_memset(&addr, 0, sizeof(addr));
+    pj_bzero(&addr, sizeof(addr));
     addr.sin_family = PJ_AF_INET;
     for (i=0; i<5; ++i) {
Index: pjproject/trunk/pjmedia/include/pjmedia/types.h
===================================================================
--- pjproject/trunk/pjmedia/include/pjmedia/types.h	(revision 581)
+++ pjproject/trunk/pjmedia/include/pjmedia/types.h	(revision 582)
@@ -169,5 +169,5 @@
 {
 #if 1
-    pj_memset(samples, 0, count*sizeof(pj_int16_t));
+    pj_bzero(samples, count*sizeof(pj_int16_t));
 #elif 0
     unsigned i;
Index: pjproject/trunk/pjmedia/src/pjmedia-codec/gsm.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia-codec/gsm.c	(revision 581)
+++ pjproject/trunk/pjmedia/src/pjmedia-codec/gsm.c	(revision 582)
@@ -242,5 +242,5 @@
     PJ_UNUSED_ARG(id);
 
-    pj_memset(attr, 0, sizeof(pjmedia_codec_param));
+    pj_bzero(attr, sizeof(pjmedia_codec_param));
     attr->info.clock_rate = 8000;
     attr->info.channel_cnt = 1;
@@ -269,5 +269,5 @@
     PJ_ASSERT_RETURN(codecs && *count > 0, PJ_EINVAL);
 
-    pj_memset(&codecs[0], 0, sizeof(pjmedia_codec_info));
+    pj_bzero(&codecs[0], sizeof(pjmedia_codec_info));
     codecs[0].encoding_name = pj_str("GSM");
     codecs[0].pt = PJMEDIA_RTP_PT_GSM;
Index: pjproject/trunk/pjmedia/src/pjmedia-codec/l16.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia-codec/l16.c	(revision 581)
+++ pjproject/trunk/pjmedia/src/pjmedia-codec/l16.c	(revision 582)
@@ -235,5 +235,5 @@
     PJ_UNUSED_ARG(factory);
 
-    pj_memset(attr, 0, sizeof(pjmedia_codec_param));
+    pj_bzero(attr, sizeof(pjmedia_codec_param));
     attr->info.pt = (pj_uint8_t)id->pt;
     attr->info.clock_rate = id->clock_rate;
Index: pjproject/trunk/pjmedia/src/pjmedia-codec/speex_codec.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia-codec/speex_codec.c	(revision 581)
+++ pjproject/trunk/pjmedia/src/pjmedia-codec/speex_codec.c	(revision 582)
@@ -382,5 +382,5 @@
     PJ_ASSERT_RETURN(factory==&spx_factory.base, PJ_EINVAL);
 
-    pj_memset(attr, 0, sizeof(pjmedia_codec_param));
+    pj_bzero(attr, sizeof(pjmedia_codec_param));
     attr->info.pt = (pj_uint8_t)id->pt;
     attr->info.channel_cnt = 1;
@@ -442,5 +442,5 @@
 	    continue;
 
-	pj_memset(&codecs[*count], 0, sizeof(pjmedia_codec_info));
+	pj_bzero(&codecs[*count], sizeof(pjmedia_codec_info));
 	codecs[*count].encoding_name = pj_str("speex");
 	codecs[*count].pt = spx_factory.speex_param[i].pt;
@@ -751,5 +751,5 @@
 
     if (input->type != PJMEDIA_FRAME_TYPE_AUDIO) {
-	pj_memset(output->buf, 0, output_buf_len);
+	pj_bzero(output->buf, output_buf_len);
 	output->size = 320;
 	output->timestamp.u64 = input->timestamp.u64;
Index: pjproject/trunk/pjmedia/src/pjmedia/conference.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/conference.c	(revision 581)
+++ pjproject/trunk/pjmedia/src/pjmedia/conference.c	(revision 582)
@@ -1533,6 +1533,5 @@
 	    mix_buf = listener->mix_buf;
 	    if (listener->src_level == 0) {
-		pj_memset(mix_buf, 0, 
-			  conf->samples_per_frame*sizeof(mix_buf[0]));
+		pj_bzero( mix_buf, conf->samples_per_frame*sizeof(mix_buf[0]));
 	    }
 
Index: pjproject/trunk/pjmedia/src/pjmedia/dsound.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/dsound.c	(revision 581)
+++ pjproject/trunk/pjmedia/src/pjmedia/dsound.c	(revision 582)
@@ -115,5 +115,5 @@
 			       unsigned channel_count)
 {
-    pj_memset(pcmwf, 0, sizeof(PCMWAVEFORMAT)); 
+    pj_bzero(pcmwf, sizeof(PCMWAVEFORMAT)); 
     pcmwf->wf.wFormatTag = WAVE_FORMAT_PCM; 
     pcmwf->wf.nChannels = (pj_uint16_t)channel_count;
@@ -177,5 +177,5 @@
 
     /* Set up DSBUFFERDESC structure. */
-    pj_memset(&dsbdesc, 0, sizeof(DSBUFFERDESC)); 
+    pj_bzero(&dsbdesc, sizeof(DSBUFFERDESC)); 
     dsbdesc.dwSize = sizeof(DSBUFFERDESC); 
     dsbdesc.dwFlags = DSBCAPS_CTRLVOLUME | DSBCAPS_CTRLPOSITIONNOTIFY |
@@ -288,5 +288,5 @@
      * to play buffer creation earlier.
      */
-    pj_memset(&dscbdesc, 0, sizeof(DSCBUFFERDESC));
+    pj_bzero(&dscbdesc, sizeof(DSCBUFFERDESC));
     dscbdesc.dwSize = sizeof(DSCBUFFERDESC); 
     dscbdesc.dwFlags = DSCBCAPS_WAVEMAPPED ;
@@ -549,5 +549,5 @@
 		
 		if (!rc) {
-		    pj_memset(strm->buffer, 0, bytes_per_frame);
+		    pj_bzero(strm->buffer, bytes_per_frame);
 		}
 
Index: pjproject/trunk/pjmedia/src/pjmedia/endpoint.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/endpoint.c	(revision 581)
+++ pjproject/trunk/pjmedia/src/pjmedia/endpoint.c	(revision 582)
@@ -486,5 +486,5 @@
 						&param) != PJ_SUCCESS)
 	{
-	    pj_memset(&param, 0, sizeof(pjmedia_codec_param));
+	    pj_bzero(&param, sizeof(pjmedia_codec_param));
 	}
 
Index: pjproject/trunk/pjmedia/src/pjmedia/g711.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/g711.c	(revision 581)
+++ pjproject/trunk/pjmedia/src/pjmedia/g711.c	(revision 582)
@@ -240,5 +240,5 @@
     PJ_UNUSED_ARG(factory);
 
-    pj_memset(attr, 0, sizeof(pjmedia_codec_param));
+    pj_bzero(attr, sizeof(pjmedia_codec_param));
     attr->info.clock_rate = 8000;
     attr->info.channel_cnt = 1;
Index: pjproject/trunk/pjmedia/src/pjmedia/jbuf.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/jbuf.c	(revision 581)
+++ pjproject/trunk/pjmedia/src/pjmedia/jbuf.c	(revision 582)
@@ -99,5 +99,5 @@
     PJ_ASSERT_RETURN(pool && framelist, PJ_EINVAL);
 
-    pj_memset(framelist, 0, sizeof(jb_framelist));
+    pj_bzero(framelist, sizeof(jb_framelist));
 
     framelist->flist_frame_size = frame_size;
@@ -147,7 +147,7 @@
 		  framelist->flist_frame_type[framelist->flist_head];
 
-	pj_memset(framelist->flist_buffer + 
+	pj_bzero(framelist->flist_buffer + 
 		    framelist->flist_head * framelist->flist_frame_size,
-		  0, framelist->flist_frame_size);
+		  framelist->flist_frame_size);
 	framelist->flist_frame_type[framelist->flist_head] = 
 	    PJMEDIA_JB_MISSING_FRAME;
@@ -162,5 +162,5 @@
 
     } else {
-	pj_memset(frame, 0, framelist->flist_frame_size);
+	pj_bzero(frame, framelist->flist_frame_size);
 	return PJ_FALSE;
     }
@@ -190,7 +190,6 @@
 	}
 
-	pj_memset(framelist->flist_buffer + 
+	pj_bzero(framelist->flist_buffer + 
 		    framelist->flist_head * framelist->flist_frame_size,
-	          0,
 	          step1*framelist->flist_frame_size);
 	pj_memset(framelist->flist_frame_type+framelist->flist_head,
@@ -199,6 +198,5 @@
 
 	if (step2) {
-	    pj_memset(framelist->flist_buffer,
-		      0,
+	    pj_bzero( framelist->flist_buffer,
 		      step2*framelist->flist_frame_size);
 	    pj_memset(framelist->flist_frame_type,
@@ -528,5 +526,5 @@
 	 * minimum prefetch.
 	 */
-	pj_memset(frame, 0, jb->jb_frame_size);
+	pj_bzero(frame, jb->jb_frame_size);
 	if (jb_framelist_size(&jb->jb_framelist) == 0)
 	    *p_frame_type = PJMEDIA_JB_ZERO_EMPTY_FRAME;
@@ -540,5 +538,5 @@
     if (jb_framelist_get(&jb->jb_framelist,frame,&ftype) == PJ_FALSE) {
 	/* Can't return frame because jitter buffer is empty! */
-	pj_memset(frame, 0, jb->jb_frame_size);
+	pj_bzero(frame, jb->jb_frame_size);
 	*p_frame_type = PJMEDIA_JB_ZERO_EMPTY_FRAME;
 
Index: pjproject/trunk/pjmedia/src/pjmedia/master_port.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/master_port.c	(revision 581)
+++ pjproject/trunk/pjmedia/src/pjmedia/master_port.c	(revision 582)
@@ -150,5 +150,5 @@
 
     /* Get frame from upstream port and pass it to downstream port */
-    pj_memset(&frame, 0, sizeof(frame));
+    pj_bzero(&frame, sizeof(frame));
     frame.buf = m->buff;
     frame.size = m->buff_size;
@@ -162,5 +162,5 @@
 
     /* Get frame from downstream port and pass it to upstream port */
-    pj_memset(&frame, 0, sizeof(frame));
+    pj_bzero(&frame, sizeof(frame));
     frame.buf = m->buff;
     frame.size = m->buff_size;
Index: pjproject/trunk/pjmedia/src/pjmedia/pasound.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/pasound.c	(revision 581)
+++ pjproject/trunk/pjmedia/src/pjmedia/pasound.c	(revision 582)
@@ -212,5 +212,5 @@
 	return NULL;
 
-    pj_memset(&info, 0, sizeof(info));
+    pj_bzero(&info, sizeof(info));
     strncpy(info.name, pa_info->name, sizeof(info.name));
     info.name[sizeof(info.name)-1] = '\0';
@@ -286,5 +286,5 @@
     stream->rec_cb = rec_cb;
 
-    pj_memset(&inputParam, 0, sizeof(inputParam));
+    pj_bzero(&inputParam, sizeof(inputParam));
     inputParam.device = index;
     inputParam.channelCount = channel_count;
@@ -379,5 +379,5 @@
     stream->play_cb = play_cb;
 
-    pj_memset(&outputParam, 0, sizeof(outputParam));
+    pj_bzero(&outputParam, sizeof(outputParam));
     outputParam.device = index;
     outputParam.channelCount = channel_count;
@@ -501,5 +501,5 @@
     stream->play_cb = play_cb;
 
-    pj_memset(&inputParam, 0, sizeof(inputParam));
+    pj_bzero(&inputParam, sizeof(inputParam));
     inputParam.device = rec_id;
     inputParam.channelCount = channel_count;
@@ -510,5 +510,5 @@
     paRecHostApiInfo = Pa_GetHostApiInfo(paRecDevInfo->hostApi);
 
-    pj_memset(&outputParam, 0, sizeof(outputParam));
+    pj_bzero(&outputParam, sizeof(outputParam));
     outputParam.device = play_id;
     outputParam.channelCount = channel_count;
Index: pjproject/trunk/pjmedia/src/pjmedia/plc_common.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/plc_common.c	(revision 581)
+++ pjproject/trunk/pjmedia/src/pjmedia/plc_common.c	(revision 582)
@@ -184,5 +184,5 @@
 	    samp[i] = (pj_int16_t)(samp[i] >> 1);
     } else {
-	pj_memset(frame, 0, o->size);
+	pj_bzero(frame, o->size);
     }
 }
Index: pjproject/trunk/pjmedia/src/pjmedia/resample_port.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/resample_port.c	(revision 581)
+++ pjproject/trunk/pjmedia/src/pjmedia/resample_port.c	(revision 582)
@@ -172,5 +172,5 @@
     /* Return silence if we don't have downstream port */
     if (rport->dn_port == NULL) {
-	pj_memset(frame->buf, frame->size, 0);
+	pj_bzero(frame->buf, frame->size);
 	return PJ_SUCCESS;
     }
Index: pjproject/trunk/pjmedia/src/pjmedia/rtcp.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/rtcp.c	(revision 581)
+++ pjproject/trunk/pjmedia/src/pjmedia/rtcp.c	(revision 582)
@@ -135,5 +135,5 @@
     
     /* Memset everything */
-    pj_memset(sess, 0, sizeof(pjmedia_rtcp_session));
+    pj_bzero(sess, sizeof(pjmedia_rtcp_session));
 
     /* Last RX timestamp in RTP packet */
Index: pjproject/trunk/pjmedia/src/pjmedia/rtp.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/rtp.c	(revision 581)
+++ pjproject/trunk/pjmedia/src/pjmedia/rtp.c	(revision 582)
@@ -61,5 +61,5 @@
 
     /* Initialize session. */
-    pj_memset(ses, 0, sizeof(*ses));
+    pj_bzero(ses, sizeof(*ses));
 
     /* Initial sequence number SHOULD be random, according to RFC 3550. */
Index: pjproject/trunk/pjmedia/src/pjmedia/sdp_neg.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/sdp_neg.c	(revision 581)
+++ pjproject/trunk/pjmedia/src/pjmedia/sdp_neg.c	(revision 582)
@@ -856,5 +856,5 @@
     answer->media_count = 0;
 
-    pj_memset(media_used, 0, sizeof(media_used));
+    pj_bzero(media_used, sizeof(media_used));
 
     /* For each media line, create our answer based on our initial
Index: pjproject/trunk/pjmedia/src/pjmedia/session.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/session.c	(revision 581)
+++ pjproject/trunk/pjmedia/src/pjmedia/session.c	(revision 582)
@@ -104,5 +104,5 @@
     /* Reset: */
 
-    pj_memset(si, 0, sizeof(*si));
+    pj_bzero(si, sizeof(*si));
 
     /* Media type: */
Index: pjproject/trunk/pjmedia/src/pjmedia/sound_port.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/sound_port.c	(revision 581)
+++ pjproject/trunk/pjmedia/src/pjmedia/sound_port.c	(revision 582)
@@ -118,5 +118,5 @@
 #endif
     } else {
-	pj_memset(output, 0, size);
+	pj_bzero(output, size);
     }
 
Index: pjproject/trunk/pjmedia/src/pjmedia/transport_udp.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/transport_udp.c	(revision 581)
+++ pjproject/trunk/pjmedia/src/pjmedia/transport_udp.c	(revision 582)
@@ -151,5 +151,5 @@
 
 
-    pj_memset(&si, 0, sizeof(pjmedia_sock_info));
+    pj_bzero(&si, sizeof(pjmedia_sock_info));
     si.rtp_sock = si.rtcp_sock = PJ_INVALID_SOCKET;
 
@@ -241,5 +241,5 @@
 
     /* Setup RTP socket with the ioqueue */
-    pj_memset(&rtp_cb, 0, sizeof(rtp_cb));
+    pj_bzero(&rtp_cb, sizeof(rtp_cb));
     rtp_cb.on_read_complete = &on_rx_rtp;
 
@@ -265,5 +265,5 @@
 
     /* Setup RTCP socket with ioqueue */
-    pj_memset(&rtcp_cb, 0, sizeof(rtcp_cb));
+    pj_bzero(&rtcp_cb, sizeof(rtcp_cb));
     rtcp_cb.on_read_complete = &on_rx_rtcp;
 
Index: pjproject/trunk/pjmedia/src/pjmedia/wav_player.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/wav_player.c	(revision 581)
+++ pjproject/trunk/pjmedia/src/pjmedia/wav_player.c	(revision 582)
@@ -493,5 +493,5 @@
 	status = fill_buffer(fport);
 	if (status != PJ_SUCCESS) {
-	    pj_memset(((char*)frame->buf)+endread, 0, frame_size-endread);
+	    pj_bzero(((char*)frame->buf)+endread, frame_size-endread);
 	    return status;
 	}
Index: pjproject/trunk/pjmedia/src/pjmedia/wav_writer.c
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia/wav_writer.c	(revision 581)
+++ pjproject/trunk/pjmedia/src/pjmedia/wav_writer.c	(revision 582)
@@ -115,5 +115,5 @@
 
     /* Initialize WAVE header */
-    pj_memset(&wave_hdr, 0, sizeof(pjmedia_wave_hdr));
+    pj_bzero(&wave_hdr, sizeof(pjmedia_wave_hdr));
     wave_hdr.riff_hdr.riff = PJMEDIA_RIFF_TAG;
     wave_hdr.riff_hdr.file_len = 0; /* will be filled later */
Index: pjproject/trunk/pjmedia/src/test/audio_tool.c
===================================================================
--- pjproject/trunk/pjmedia/src/test/audio_tool.c	(revision 581)
+++ pjproject/trunk/pjmedia/src/test/audio_tool.c	(revision 582)
@@ -171,5 +171,5 @@
 #endif
 
-    pj_memset(&info, 0, sizeof(info));
+    pj_bzero(&info, sizeof(info));
     info.bits_per_sample = 16;
     info.bytes_per_frame = 2;
@@ -218,5 +218,5 @@
 	return -1;
 
-    pj_memset(&info, 0, sizeof(info));
+    pj_bzero(&info, sizeof(info));
     info.bits_per_sample = 16;
     info.bytes_per_frame = 2;
@@ -264,5 +264,5 @@
     }
 
-    pj_memset(&skinfo, 0, sizeof(skinfo));
+    pj_bzero(&skinfo, sizeof(skinfo));
     skinfo.rtp_sock = skinfo.rtcp_sock = pj_sock_socket(PJ_AF_INET, PJ_SOCK_DGRAM, 0, 0);
     if (skinfo.rtp_sock == PJ_INVALID_SOCKET) {
Index: pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
===================================================================
--- pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c	(revision 581)
+++ pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c	(revision 582)
@@ -1740,5 +1740,5 @@
 		}
 
-		pj_memset(&buddy_cfg, 0, sizeof(pjsua_buddy_config));
+		pj_bzero(&buddy_cfg, sizeof(pjsua_buddy_config));
 
 		buddy_cfg.uri = pj_str(buf);
Index: pjproject/trunk/pjsip-apps/src/samples/pjsip-perf.c
===================================================================
--- pjproject/trunk/pjsip-apps/src/samples/pjsip-perf.c	(revision 581)
+++ pjproject/trunk/pjsip-apps/src/samples/pjsip-perf.c	(revision 582)
@@ -628,5 +628,5 @@
 	const char *transport_type;
 
-	pj_memset(&addr, 0, sizeof(addr));
+	pj_bzero(&addr, sizeof(addr));
 	addr.sin_family = PJ_AF_INET;
 	addr.sin_addr.s_addr = 0;
@@ -697,5 +697,5 @@
 
 	/* Init the callback for INVITE session: */
-	pj_memset(&inv_cb, 0, sizeof(inv_cb));
+	pj_bzero(&inv_cb, sizeof(inv_cb));
 	inv_cb.on_state_changed = &call_on_state_changed;
 	inv_cb.on_new_session = &call_on_forked;
Index: pjproject/trunk/pjsip-apps/src/samples/simpleua.c
===================================================================
--- pjproject/trunk/pjsip-apps/src/samples/simpleua.c	(revision 581)
+++ pjproject/trunk/pjsip-apps/src/samples/simpleua.c	(revision 582)
@@ -226,5 +226,5 @@
 
 	/* Init the callback for INVITE session: */
-	pj_memset(&inv_cb, 0, sizeof(inv_cb));
+	pj_bzero(&inv_cb, sizeof(inv_cb));
 	inv_cb.on_state_changed = &call_on_state_changed;
 	inv_cb.on_new_session = &call_on_forked;
Index: pjproject/trunk/pjsip-apps/src/samples/siprtp.c
===================================================================
--- pjproject/trunk/pjsip-apps/src/samples/siprtp.c	(revision 581)
+++ pjproject/trunk/pjsip-apps/src/samples/siprtp.c	(revision 582)
@@ -303,5 +303,5 @@
 	pjsip_host_port addrname;
 
-	pj_memset(&addr, 0, sizeof(addr));
+	pj_bzero(&addr, sizeof(addr));
 	addr.sin_family = PJ_AF_INET;
 	addr.sin_addr.s_addr = 0;
@@ -338,5 +338,5 @@
 
 	/* Init the callback for INVITE session: */
-	pj_memset(&inv_cb, 0, sizeof(inv_cb));
+	pj_bzero(&inv_cb, sizeof(inv_cb));
 	inv_cb.on_state_changed = &call_on_state_changed;
 	inv_cb.on_new_session = &call_on_forked;
@@ -1157,5 +1157,5 @@
 
 	/* Zero the payload */
-	pj_memset(packet+hdrlen, 0, strm->bytes_per_frame);
+	pj_bzero(packet+hdrlen, strm->bytes_per_frame);
 
 	/* Send RTP packet */
Index: pjproject/trunk/pjsip-apps/src/samples/sndtest.c
===================================================================
--- pjproject/trunk/pjsip-apps/src/samples/sndtest.c	(revision 581)
+++ pjproject/trunk/pjsip-apps/src/samples/sndtest.c	(revision 582)
@@ -154,5 +154,5 @@
     /* Skip frames when test is not started or test has finished */
     if (!test_data->running) {
-	pj_memset(output, 0, size);
+	pj_bzero(output, size);
 	return PJ_SUCCESS;
     }
@@ -194,5 +194,5 @@
     }
 
-    pj_memset(output, 0, size);
+    pj_bzero(output, size);
     return PJ_SUCCESS;
 }
@@ -381,5 +381,5 @@
      * Init test parameters
      */
-    pj_memset(&test_data, 0, sizeof(test_data));
+    pj_bzero(&test_data, sizeof(test_data));
     test_data.dir = dir;
     test_data.clock_rate = clock_rate;
Index: pjproject/trunk/pjsip-apps/src/samples/streamutil.c
===================================================================
--- pjproject/trunk/pjsip-apps/src/samples/streamutil.c	(revision 581)
+++ pjproject/trunk/pjsip-apps/src/samples/streamutil.c	(revision 582)
@@ -128,5 +128,5 @@
 
     /* Reset stream info. */
-    pj_memset(&info, 0, sizeof(info));
+    pj_bzero(&info, sizeof(info));
 
 
@@ -231,5 +231,5 @@
 
 
-    pj_memset(&remote_addr, 0, sizeof(remote_addr));
+    pj_bzero(&remote_addr, sizeof(remote_addr));
 
 
Index: pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
===================================================================
--- pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h	(revision 581)
+++ pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h	(revision 582)
@@ -252,5 +252,5 @@
 PJ_INLINE(void) pjsua_logging_config_default(pjsua_logging_config *cfg)
 {
-    pj_memset(cfg, 0, sizeof(*cfg));
+    pj_bzero(cfg, sizeof(*cfg));
 
     cfg->msg_logging = PJ_TRUE;
@@ -428,5 +428,5 @@
 PJ_INLINE(void) pjsua_config_default(pjsua_config *cfg)
 {
-    pj_memset(cfg, 0, sizeof(*cfg));
+    pj_bzero(cfg, sizeof(*cfg));
 
     cfg->max_calls = 4;
@@ -504,5 +504,5 @@
 PJ_INLINE(void) pjsua_msg_data_init(pjsua_msg_data *msg_data)
 {
-    pj_memset(msg_data, 0, sizeof(*msg_data));
+    pj_bzero(msg_data, sizeof(*msg_data));
     pj_list_init(&msg_data->hdr_list);
 }
@@ -704,5 +704,5 @@
 PJ_INLINE(void) pjsua_stun_config_default(pjsua_stun_config *cfg)
 {
-    pj_memset(cfg, 0, sizeof(*cfg));
+    pj_bzero(cfg, sizeof(*cfg));
 }
 
@@ -747,5 +747,5 @@
 PJ_INLINE(void) pjsua_transport_config_default(pjsua_transport_config *cfg)
 {
-    pj_memset(cfg, 0, sizeof(*cfg));
+    pj_bzero(cfg, sizeof(*cfg));
 }
 
@@ -1073,5 +1073,5 @@
 PJ_INLINE(void) pjsua_acc_config_default(pjsua_acc_config *cfg)
 {
-    pj_memset(cfg, 0, sizeof(*cfg));
+    pj_bzero(cfg, sizeof(*cfg));
 
     cfg->reg_timeout = PJSUA_REG_INTERVAL;
@@ -2059,5 +2059,5 @@
 PJ_INLINE(void) pjsua_media_config_default(pjsua_media_config *cfg)
 {
-    pj_memset(cfg, 0, sizeof(*cfg));
+    pj_bzero(cfg, sizeof(*cfg));
 
     cfg->clock_rate = 16000;
Index: pjproject/trunk/pjsip/src/pjsip/sip_endpoint.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_endpoint.c	(revision 581)
+++ pjproject/trunk/pjsip/src/pjsip/sip_endpoint.c	(revision 582)
@@ -843,5 +843,5 @@
      * rdata may be reused.
      */
-    pj_memset(&rdata->endpt_info, 0, sizeof(rdata->endpt_info));
+    pj_bzero(&rdata->endpt_info, sizeof(rdata->endpt_info));
 }
 
Index: pjproject/trunk/pjsip/src/pjsip/sip_msg.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_msg.c	(revision 581)
+++ pjproject/trunk/pjsip/src/pjsip/sip_msg.c	(revision 582)
@@ -969,5 +969,5 @@
     PJ_UNUSED_ARG(pool);
 
-    pj_memset(mem, 0, sizeof(pjsip_contact_hdr));
+    pj_bzero(mem, sizeof(pjsip_contact_hdr));
     init_hdr(hdr, PJSIP_H_CONTACT, &contact_hdr_vptr);
     hdr->expires = -1;
@@ -1098,5 +1098,5 @@
     PJ_UNUSED_ARG(pool);
 
-    pj_memset(mem, 0, sizeof(pjsip_ctype_hdr));
+    pj_bzero(mem, sizeof(pjsip_ctype_hdr));
     init_hdr(hdr, PJSIP_H_CONTENT_TYPE, &ctype_hdr_vptr);
     return hdr;
@@ -1214,5 +1214,5 @@
     PJ_UNUSED_ARG(pool);
 
-    pj_memset(mem, 0, sizeof(pjsip_from_hdr));
+    pj_bzero(mem, sizeof(pjsip_from_hdr));
     init_hdr(hdr, PJSIP_H_FROM, &fromto_hdr_vptr);
     pj_list_init(&hdr->other_param);
@@ -1233,5 +1233,5 @@
     PJ_UNUSED_ARG(pool);
 
-    pj_memset(mem, 0, sizeof(pjsip_to_hdr));
+    pj_bzero(mem, sizeof(pjsip_to_hdr));
     init_hdr(hdr, PJSIP_H_TO, &fromto_hdr_vptr);
     pj_list_init(&hdr->other_param);
@@ -1596,5 +1596,5 @@
     PJ_UNUSED_ARG(pool);
 
-    pj_memset(mem, 0, sizeof(pjsip_via_hdr));
+    pj_bzero(mem, sizeof(pjsip_via_hdr));
     init_hdr(hdr, PJSIP_H_VIA, &via_hdr_vptr);
     hdr->ttl_param = -1;
Index: pjproject/trunk/pjsip/src/pjsip/sip_transport.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_transport.c	(revision 581)
+++ pjproject/trunk/pjsip/src/pjsip/sip_transport.c	(revision 582)
@@ -596,5 +596,5 @@
     /* Init. */
     tp->tpmgr = mgr;
-    pj_memset(&tp->idle_timer, 0, sizeof(tp->idle_timer));
+    pj_bzero(&tp->idle_timer, sizeof(tp->idle_timer));
     tp->idle_timer.user_data = tp;
     tp->idle_timer.cb = &transport_idle_callback;
@@ -927,5 +927,5 @@
 	 * to report some errors.
 	 */
-	pj_memset(&rdata->msg_info, 0, sizeof(rdata->msg_info));
+	pj_bzero(&rdata->msg_info, sizeof(rdata->msg_info));
 	pj_list_init(&rdata->msg_info.parse_err);
 	rdata->msg_info.msg_buf = current_pkt;
@@ -1098,5 +1098,5 @@
 	    pj_sockaddr_in *addr = (pj_sockaddr_in*)&key.addr;
 
-	    pj_memset(addr, 0, sizeof(pj_sockaddr_in));
+	    pj_bzero(addr, sizeof(pj_sockaddr_in));
 	    key_len = sizeof(key.type) + sizeof(pj_sockaddr_in);
 	    transport = pj_hash_get(mgr->table, &key, key_len, NULL);
@@ -1109,5 +1109,5 @@
 	    pj_sockaddr_in *addr = (pj_sockaddr_in*)&key.addr;
 
-	    pj_memset(addr, 0, sizeof(pj_sockaddr_in));
+	    pj_bzero(addr, sizeof(pj_sockaddr_in));
 	    addr->sin_family = PJ_AF_INET;
 
Index: pjproject/trunk/pjsip/src/pjsip/sip_transport_tcp.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_transport_tcp.c	(revision 581)
+++ pjproject/trunk/pjsip/src/pjsip/sip_transport_tcp.c	(revision 582)
@@ -271,5 +271,5 @@
 
     /* Register socket to ioqeuue */
-    pj_memset(&listener_cb, 0, sizeof(listener_cb));
+    pj_bzero(&listener_cb, sizeof(listener_cb));
     listener_cb.on_accept_complete = &on_accept_complete;
     status = pj_ioqueue_register_sock(pool, pjsip_endpt_get_ioqueue(endpt),
@@ -475,5 +475,5 @@
 
     /* Register socket to ioqueue */
-    pj_memset(&tcp_callback, 0, sizeof(pj_ioqueue_callback));
+    pj_bzero(&tcp_callback, sizeof(pj_ioqueue_callback));
     tcp_callback.on_read_complete = &on_read_complete;
     tcp_callback.on_write_complete = &on_write_complete;
Index: pjproject/trunk/pjsip/src/pjsip/sip_uri.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_uri.c	(revision 581)
+++ pjproject/trunk/pjsip/src/pjsip/sip_uri.c	(revision 582)
@@ -207,5 +207,5 @@
 PJ_DEF(void) pjsip_sip_uri_init(pjsip_sip_uri *url, int secure)
 {
-    pj_memset(url, 0, sizeof(*url));
+    pj_bzero(url, sizeof(*url));
     url->ttl_param = -1;
     url->vptr = secure ? &sips_url_vptr : &sip_url_vptr;
Index: pjproject/trunk/pjsip/src/pjsip/sip_util.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsip/sip_util.c	(revision 581)
+++ pjproject/trunk/pjsip/src/pjsip/sip_util.c	(revision 582)
@@ -706,5 +706,5 @@
      * Otherwise we're in trouble (i.e. there's no host part in tel: URL).
      */
-    pj_memset(dest_info, 0, sizeof(*dest_info));
+    pj_bzero(dest_info, sizeof(*dest_info));
 
     if (PJSIP_URI_SCHEME_IS_SIPS(target_uri)) {
Index: pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c	(revision 581)
+++ pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c	(revision 582)
@@ -549,5 +549,5 @@
     PJ_ASSERT_RETURN(info != NULL, PJ_EINVAL);
     
-    pj_memset(info, 0, sizeof(pjsua_acc_info));
+    pj_bzero(info, sizeof(pjsua_acc_info));
 
     PJ_ASSERT_RETURN(acc_id>=0 && acc_id<(int)PJ_ARRAY_SIZE(pjsua_var.acc), 
Index: pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c	(revision 581)
+++ pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c	(revision 582)
@@ -105,5 +105,5 @@
 
     /* Initialize invite session callback. */
-    pj_memset(&inv_cb, 0, sizeof(inv_cb));
+    pj_bzero(&inv_cb, sizeof(inv_cb));
     inv_cb.on_state_changed = &pjsua_call_on_state_changed;
     inv_cb.on_new_session = &pjsua_call_on_forked;
@@ -563,5 +563,5 @@
 		     PJ_EINVAL);
 
-    pj_memset(info, 0, sizeof(*info));
+    pj_bzero(info, sizeof(*info));
 
     PJSUA_LOCK();
@@ -2129,5 +2129,5 @@
 
     /* Init callback */
-    pj_memset(&xfer_cb, 0, sizeof(xfer_cb));
+    pj_bzero(&xfer_cb, sizeof(xfer_cb));
     xfer_cb.on_evsub_state = &xfer_on_evsub_state;
 
Index: pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c	(revision 581)
+++ pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c	(revision 582)
@@ -668,5 +668,5 @@
 	pjsua_normalize_stun_config(&stun);
     } else {
-	pj_memset(&stun, 0, sizeof(pjsua_stun_config));
+	pj_bzero(&stun, sizeof(pjsua_stun_config));
     }
 
@@ -699,5 +699,5 @@
 	}
 
-	pj_memset(p_pub_addr, 0, sizeof(pj_sockaddr_in));
+	pj_bzero(p_pub_addr, sizeof(pj_sockaddr_in));
 	p_pub_addr->sin_family = PJ_AF_INET;
 	p_pub_addr->sin_port = pj_htons((pj_uint16_t)port);
@@ -911,5 +911,5 @@
     struct transport_data *t = &pjsua_var.tpdata[id];
 
-    pj_memset(info, 0, sizeof(*info));
+    pj_bzero(info, sizeof(*info));
 
     /* Make sure id is in range. */
@@ -1077,5 +1077,5 @@
     char *pos;
 
-    pj_memset(media_type, 0, sizeof(*media_type));
+    pj_bzero(media_type, sizeof(*media_type));
 
     pj_strdup_with_null(pool, &tmp, mime);
Index: pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c	(revision 581)
+++ pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c	(revision 582)
@@ -267,5 +267,5 @@
 	    hostname = pj_gethostname();
 
-	    pj_memset( &addr, 0, sizeof(addr));
+	    pj_bzero( &addr, sizeof(addr));
 	    addr.sin_family = PJ_AF_INET;
 	    status = pj_sockaddr_in_set_str_addr( &addr, hostname);
@@ -553,5 +553,5 @@
 	return status;
 
-    pj_memset(info, 0, sizeof(*info));
+    pj_bzero(info, sizeof(*info));
     info->slot_id = id;
     info->name = cinfo.name;
Index: pjproject/trunk/pjsip/src/pjsua-lib/pjsua_pres.c
===================================================================
--- pjproject/trunk/pjsip/src/pjsua-lib/pjsua_pres.c	(revision 581)
+++ pjproject/trunk/pjsip/src/pjsua-lib/pjsua_pres.c	(revision 582)
@@ -86,5 +86,5 @@
     PJSUA_LOCK();
 
-    pj_memset(info, 0, sizeof(pjsua_buddy_info));
+    pj_bzero(info, sizeof(pjsua_buddy_info));
 
     buddy = &pjsua_var.buddy[buddy_id];
@@ -130,5 +130,5 @@
 static void reset_buddy(pjsua_buddy_id id)
 {
-    pj_memset(&pjsua_var.buddy[id], 0, sizeof(pjsua_var.buddy[id]));
+    pj_bzero(&pjsua_var.buddy[id], sizeof(pjsua_var.buddy[id]));
     pjsua_var.buddy[id].index = id;
 }
@@ -480,5 +480,5 @@
 
     /* Init callback: */
-    pj_memset(&pres_cb, 0, sizeof(pres_cb));
+    pj_bzero(&pres_cb, sizeof(pres_cb));
     pres_cb.on_evsub_state = &pres_evsub_on_srv_state;
 
@@ -523,5 +523,5 @@
 
     /* Set our online status: */
-    pj_memset(&pres_status, 0, sizeof(pres_status));
+    pj_bzero(&pres_status, sizeof(pres_status));
     pres_status.info_cnt = 1;
     pres_status.info[0].basic_open = pjsua_var.acc[acc_id].online_status;
Index: pjproject/trunk/pjsip/src/test-pjsip/msg_test.c
===================================================================
--- pjproject/trunk/pjsip/src/test-pjsip/msg_test.c	(revision 581)
+++ pjproject/trunk/pjsip/src/test-pjsip/msg_test.c	(revision 582)
@@ -712,5 +712,5 @@
 
 
-    pj_memset(&var, 0, sizeof(var));
+    pj_bzero(&var, sizeof(var));
     zero.u64 = 0;
 
Index: pjproject/trunk/pjsip/src/test-pjsip/transport_test.c
===================================================================
--- pjproject/trunk/pjsip/src/test-pjsip/transport_test.c	(revision 581)
+++ pjproject/trunk/pjsip/src/test-pjsip/transport_test.c	(revision 582)
@@ -555,5 +555,5 @@
 	pj_str_t str_id = { buf, 1 };
 
-	pj_memset(&rt_test_data[i], 0, sizeof(rt_test_data[i]));
+	pj_bzero(&rt_test_data[i], sizeof(rt_test_data[i]));
 
 	/* Init timer entry */
@@ -614,6 +614,6 @@
 
     /* Gather statistics. */
-    pj_memset(&total_time, 0, sizeof(total_time));
-    pj_memset(&zero_time, 0, sizeof(zero_time));
+    pj_bzero(&total_time, sizeof(total_time));
+    pj_bzero(&zero_time, sizeof(zero_time));
     usec_rt = total_sent = total_recv = 0;
     for (i=0; i<THREADS; ++i) {
Index: pjproject/trunk/pjsip/src/test-pjsip/tsx_bench.c
===================================================================
--- pjproject/trunk/pjsip/src/test-pjsip/tsx_bench.c	(revision 581)
+++ pjproject/trunk/pjsip/src/test-pjsip/tsx_bench.c	(revision 582)
@@ -52,5 +52,5 @@
     tsx = pj_pool_zalloc(request->pool, working_set * sizeof(pj_pool_t*));
 
-    pj_memset(&mod_tsx_user, 0, sizeof(mod_tsx_user));
+    pj_bzero(&mod_tsx_user, sizeof(mod_tsx_user));
     mod_tsx_user.id = -1;
 
@@ -122,5 +122,5 @@
 
     /* Create "dummy" rdata from the tdata */
-    pj_memset(&rdata, 0, sizeof(pjsip_rx_data));
+    pj_bzero(&rdata, sizeof(pjsip_rx_data));
     rdata.tp_info.pool = request->pool;
     rdata.msg_info.msg = request->msg;
@@ -144,5 +144,5 @@
     tsx = pj_pool_zalloc(request->pool, working_set * sizeof(pj_pool_t*));
 
-    pj_memset(&mod_tsx_user, 0, sizeof(mod_tsx_user));
+    pj_bzero(&mod_tsx_user, sizeof(mod_tsx_user));
     mod_tsx_user.id = -1;
 
Index: pjproject/trunk/pjsip/src/test-pjsip/txdata_test.c
===================================================================
--- pjproject/trunk/pjsip/src/test-pjsip/txdata_test.c	(revision 581)
+++ pjproject/trunk/pjsip/src/test-pjsip/txdata_test.c	(revision 582)
@@ -266,5 +266,5 @@
 
     /* Modify dummy_rdata to simulate receiving response. */
-    pj_memset(&dummy_rdata, 0, sizeof(dummy_rdata));
+    pj_bzero(&dummy_rdata, sizeof(dummy_rdata));
     dummy_rdata.msg_info.msg = response->msg;
     dummy_rdata.msg_info.to = HFIND(response->msg, to, TO);
@@ -633,5 +633,5 @@
 
     for (i=0; i<LOOP; i+=COUNT) {
-	pj_memset(tdata, 0, sizeof(tdata));
+	pj_bzero(tdata, sizeof(tdata));
 
 	pj_get_timestamp(&t1);
@@ -712,5 +712,5 @@
 
     /* Create "dummy" rdata from the tdata */
-    pj_memset(&rdata, 0, sizeof(pjsip_rx_data));
+    pj_bzero(&rdata, sizeof(pjsip_rx_data));
     rdata.tp_info.pool = request->pool;
     rdata.msg_info.msg = request->msg;
@@ -727,5 +727,5 @@
 
     for (i=0; i<LOOP; i+=COUNT) {
-	pj_memset(tdata, 0, sizeof(tdata));
+	pj_bzero(tdata, sizeof(tdata));
 
 	pj_get_timestamp(&t1);
Index: pjproject/trunk/pjsip/src/test-pjsip/uri_test.c
===================================================================
--- pjproject/trunk/pjsip/src/test-pjsip/uri_test.c	(revision 581)
+++ pjproject/trunk/pjsip/src/test-pjsip/uri_test.c	(revision 582)
@@ -824,5 +824,5 @@
     pj_highprec_t avg_parse, avg_print, avg_cmp, kbytes;
 
-    pj_memset(&var, 0, sizeof(var));
+    pj_bzero(&var, sizeof(var));
 
     zero.u32.hi = zero.u32.lo = 0;
