diff --git a/src/stralloc.c b/src/stralloc.c index 120d16069cfaababc9d62b96f3932d53679bec6f..f9511d706a6e0cbbb6d36a6de139eaff66c78dce 100644 --- a/src/stralloc.c +++ b/src/stralloc.c @@ -25,7 +25,7 @@ #define HUGE HUGE_VAL #endif /*!HUGE*/ -RCSID("$Id: stralloc.c,v 1.98 2000/08/15 11:41:28 grubba Exp $"); +RCSID("$Id: stralloc.c,v 1.99 2000/09/03 23:20:12 mast Exp $"); #define BEGIN_HASH_SIZE 997 #define MAX_AVG_LINK_LENGTH 3 @@ -1589,6 +1589,21 @@ void count_memory_in_strings(INT32 *num, INT32 *size) size[0]=size_; } +#ifdef PIKE_DEBUG +unsigned gc_touch_all_strings(void) +{ + unsigned INT32 e; + unsigned n = 0; + if (!base_table) return 0; + for(e=0;e<htable_size;e++) + { + struct pike_string *p; + for(p=base_table[e];p;p=p->next) debug_gc_touch(p), n++; + } + return n; +} +#endif + void gc_mark_all_strings(void) { unsigned INT32 e; diff --git a/src/stralloc.h b/src/stralloc.h index 18d21fe56b804ba08caf0cff408b45d64468cd15..aa571b0920c6006bc3b1d5795975705766497b59 100644 --- a/src/stralloc.h +++ b/src/stralloc.h @@ -5,7 +5,7 @@ \*/ /* - * $Id: stralloc.h,v 1.55 2000/08/15 11:41:45 grubba Exp $ + * $Id: stralloc.h,v 1.56 2000/09/03 23:20:12 mast Exp $ */ #ifndef STRALLOC_H #define STRALLOC_H @@ -228,6 +228,7 @@ PMOD_EXPORT struct pike_string *string_replace(struct pike_string *str, void init_shared_string_table(void); void cleanup_shared_string_table(void); void count_memory_in_strings(INT32 *num, INT32 *size); +unsigned gc_touch_all_strings(void); void gc_mark_all_strings(void); PMOD_EXPORT void init_string_builder(struct string_builder *s, int mag); PMOD_EXPORT void *string_builder_allocate(struct string_builder *s,