cedric pushed a commit to branch master.
commit 95471668789d2046f8e23a3b2fc4c7fb0bb917f9
Author: Cedric Bail <[email protected]>
Date: Thu Apr 11 11:57:57 2013 +0900
eina: little speed improvement by reducing chance to call function.
---
src/lib/eina/eina_cow.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/lib/eina/eina_cow.c b/src/lib/eina/eina_cow.c
index c1bac93..8010f62 100644
--- a/src/lib/eina/eina_cow.c
+++ b/src/lib/eina/eina_cow.c
@@ -197,7 +197,7 @@ _eina_cow_cmp(const void *key1, int key1_length,
return memcmp(key1, key2, key1_length);
}
-static void
+static inline void
_eina_cow_hash_del(Eina_Cow *cow,
const void *data,
Eina_Cow_Ptr *ref)
@@ -216,7 +216,7 @@ _eina_cow_gc_free(void *data)
eina_mempool_free(gc_pool, data);
}
-static void
+static inline void
_eina_cow_togc_del(Eina_Cow *cow, Eina_Cow_Ptr *ref)
{
/* eina_cow_gc is not supposed to be thread safe */
@@ -482,7 +482,9 @@ eina_cow_write(Eina_Cow *cow,
}
#endif
- _eina_cow_hash_del(cow, *data, ref);
+ if (cow->togc)
+ _eina_cow_hash_del(cow, *data, ref);
+
#ifndef NVALGRIND
VALGRIND_MAKE_MEM_NOACCESS(ref, sizeof (*ref));
#endif
--
------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter