[asterisk-commits] dlee: branch dlee/performance r399497 - /team/dlee/performance/main/astobj2.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Sep 19 15:44:38 CDT 2013
Author: dlee
Date: Thu Sep 19 15:44:37 2013
New Revision: 399497
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=399497
Log:
ao2_ref doesn't _need_ to memset the header
Modified:
team/dlee/performance/main/astobj2.c
Modified: team/dlee/performance/main/astobj2.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/performance/main/astobj2.c?view=diff&rev=399497&r1=399496&r2=399497
==============================================================================
--- team/dlee/performance/main/astobj2.c (original)
+++ team/dlee/performance/main/astobj2.c Thu Sep 19 15:44:37 2013
@@ -483,33 +483,39 @@
obj_mutex = INTERNAL_OBJ_MUTEX(user_data);
ast_mutex_destroy(&obj_mutex->mutex.lock);
+#ifdef AO2_DEBUG
/*
* For safety, zero-out the astobj2_lock header and also the
* first word of the user-data, which we make sure is always
* allocated.
*/
memset(obj_mutex, '\0', sizeof(*obj_mutex) + sizeof(void *) );
+#endif
ast_free(obj_mutex);
break;
case AO2_ALLOC_OPT_LOCK_RWLOCK:
obj_rwlock = INTERNAL_OBJ_RWLOCK(user_data);
ast_rwlock_destroy(&obj_rwlock->rwlock.lock);
+#ifdef AO2_DEBUG
/*
* For safety, zero-out the astobj2_rwlock header and also the
* first word of the user-data, which we make sure is always
* allocated.
*/
memset(obj_rwlock, '\0', sizeof(*obj_rwlock) + sizeof(void *) );
+#endif
ast_free(obj_rwlock);
break;
case AO2_ALLOC_OPT_LOCK_NOLOCK:
+#ifdef AO2_DEBUG
/*
* For safety, zero-out the astobj2 header and also the first
* word of the user-data, which we make sure is always
* allocated.
*/
memset(obj, '\0', sizeof(*obj) + sizeof(void *) );
+#endif
ast_free(obj);
break;
default:
More information about the asterisk-commits
mailing list