aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-memory.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2002-07-16 10:41:01 +0800
committerMichael Zucci <zucchi@src.gnome.org>2002-07-16 10:41:01 +0800
commit8d208b95bb0a9a240f0ac5a9110be1ebf550ac15 (patch)
tree7f08c696f8dc983525670aafbba9e1adbff8efd4 /e-util/e-memory.c
parent7f0ab8334b1dcdf8beb19ea28005ba6055c7bfc0 (diff)
downloadgsoc2013-evolution-8d208b95bb0a9a240f0ac5a9110be1ebf550ac15.tar.gz
gsoc2013-evolution-8d208b95bb0a9a240f0ac5a9110be1ebf550ac15.tar.zst
gsoc2013-evolution-8d208b95bb0a9a240f0ac5a9110be1ebf550ac15.zip
Cast to a string type. (term_eval_castint): Cast to an int type.
2002-07-15 Not Zed <NotZed@Ximian.com> * e-sexp.c (term_eval_caststring): Cast to a string type. (term_eval_castint): Cast to an int type. (symbols[]): Add to symbol table. * e-memory.c: Some more profiling for epoolv's. svn path=/trunk/; revision=17474
Diffstat (limited to 'e-util/e-memory.c')
-rw-r--r--e-util/e-memory.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/e-util/e-memory.c b/e-util/e-memory.c
index 108a627076..17385fa7ba 100644
--- a/e-util/e-memory.c
+++ b/e-util/e-memory.c
@@ -32,7 +32,7 @@
/*#define MALLOC_CHECK*/
-/* #define PROFILE_POOLV */
+/*#define PROFILE_POOLV*/
#ifdef PROFILE_POOLV
#include <time.h>
@@ -871,6 +871,7 @@ static GPtrArray *poolv_table = NULL;
#ifdef PROFILE_POOLV
static gulong poolv_hits = 0;
static gulong poolv_misses = 0;
+static unsigned long poolv_mem, poolv_count;
#endif
#ifdef G_THREADS_ENABLED
@@ -937,6 +938,9 @@ e_poolv_new(unsigned int size)
p(printf("new poolv=%p\tsize=%d\n", poolv, sizeof(*poolv) + (size-1)*sizeof(char *)));
+#ifdef PROFILE_POOLV
+ poolv_count++;
+#endif
return poolv;
}
@@ -1018,9 +1022,10 @@ poolv_profile_update (void)
if (new_time - last_time < 5)
return;
- printf("poolv profile: %lu hits, %lu misses: %d%% hit rate\n",
+ printf("poolv profile: %lu hits, %lu misses: %d%% hit rate, memory: %lu, instances: %lu\n",
poolv_hits, poolv_misses,
- (int)(100.0 * ((double) poolv_hits / (double) (poolv_hits + poolv_misses))));
+ (int)(100.0 * ((double) poolv_hits / (double) (poolv_hits + poolv_misses))),
+ poolv_mem, poolv_count);
last_time = new_time;
}
@@ -1086,6 +1091,7 @@ e_poolv_set (EPoolv *poolv, int index, char *str, int freeit)
} else {
# ifdef PROFILE_POOLV
poolv_misses++;
+ poolv_mem += strlen(str);
poolv_profile_update ();
# endif
poolv->s[index] = e_mempool_strdup(poolv_mempool, str);
@@ -1101,6 +1107,7 @@ e_poolv_set (EPoolv *poolv, int index, char *str, int freeit)
} else {
# ifdef PROFILE_POOLV
poolv_misses++;
+ poolv_mem += strlen(str);
poolv_profile_update ();
# endif
poolv->s[index] = e_mempool_strdup(poolv_mempool, str);
@@ -1187,6 +1194,9 @@ e_poolv_destroy(EPoolv *poolv)
#endif
#endif
+#ifdef PROFILE_POOLV
+ poolv_count++;
+#endif
g_free(poolv);
}