From: Arnaud Giersch Date: Tue, 11 Dec 2012 14:13:41 +0000 (+0100) Subject: Rename function (create->reset), and kill empty function (destroy). X-Git-Tag: v3_9_rc1~86^2~132 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/6af11f57f8a7fc1e6694ce8226db505c7bcaa00e?hp=4eb9402362d5ecd76b79b1054ba37a8de264a280 Rename function (create->reset), and kill empty function (destroy). --- diff --git a/src/xbt/mallocator.c b/src/xbt/mallocator.c index 3acc9b3123..10883555b9 100644 --- a/src/xbt/mallocator.c +++ b/src/xbt/mallocator.c @@ -42,15 +42,11 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(xbt_mallocator, xbt, "Mallocators"); * mallocators should be protected from concurrent accesses. */ static int initialization_done = 0; -static XBT_INLINE void lock_create(xbt_mallocator_t m) +static XBT_INLINE void lock_reset(xbt_mallocator_t m) { m->lock = 0; } -static XBT_INLINE void lock_destroy(xbt_mallocator_t m) -{ -} - static XBT_INLINE void lock_acquire(xbt_mallocator_t m) { if (initialization_done > 1) { @@ -147,7 +143,6 @@ void xbt_mallocator_free(xbt_mallocator_t m) m->free_f(m->objects[i]); } xbt_free(m->objects); - lock_destroy(m); xbt_free(m); } @@ -195,7 +190,7 @@ void *xbt_mallocator_get(xbt_mallocator_t m) if (xbt_mallocator_is_active()) { // We have to switch this mallocator from inactive to active (and then get an object) m->objects = xbt_new0(void *, m->max_size); - lock_create(m); + lock_reset(m); return xbt_mallocator_get(m); } else { object = m->new_f(); @@ -242,7 +237,7 @@ void xbt_mallocator_release(xbt_mallocator_t m, void *object) if (xbt_mallocator_is_active()) { // We have to switch this mallocator from inactive to active (and then store that object) m->objects = xbt_new0(void *, m->max_size); - lock_create(m); + lock_reset(m); xbt_mallocator_release(m,object); } else { m->free_f(object);