From 8d208b95bb0a9a240f0ac5a9110be1ebf550ac15 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Tue, 16 Jul 2002 02:41:01 +0000 Subject: Cast to a string type. (term_eval_castint): Cast to an int type. 2002-07-15 Not Zed * 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 --- e-util/e-memory.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'e-util/e-memory.c') 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 @@ -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); } -- cgit v1.2.3