2001-12-19
2001-12-19 23:44:00 by Martin Stjernholm <mast@lysator.liu.se>
-
7ff571f2db83ac0cb575c06e370b88c6bce09853
(10 lines)
(+9/-1)
[
Show
| Annotate
]
Branch: 7.9
Added empty_string since it's often useful to have around.
Rev: src/stralloc.c:1.139
Rev: src/stralloc.h:1.63
27:
#define HUGE HUGE_VAL
#endif /*!HUGE*/
- RCSID("$Id: stralloc.c,v 1.138 2001/11/09 02:09:14 nilsson Exp $");
+ RCSID("$Id: stralloc.c,v 1.139 2001/12/19 23:44:00 mast Exp $");
/* #define STRALLOC_USE_PRIMES */
90:
static unsigned int hashprimes_entry=0;
static struct pike_string **base_table=0;
unsigned INT32 num_strings=0;
+ PMOD_EXPORT struct pike_string *empty_string = 0;
/*** Main string hash function ***/
1800: Inside #if defined(PIKE_RUN_UNLOCKED)
for(h=0;h<BUCKET_LOCKS;h++) mt_init(bucket_locks + h);
}
#endif
+ empty_string = make_shared_string("");
}
#ifdef DEBUG_MALLOC
1812:
unsigned INT32 e;
struct pike_string *s,*next;
+ if (empty_string) {
+ free_string(empty_string);
+ empty_string = 0;
+ }
+
#if defined(PIKE_DEBUG) && defined(DEBUG_MALLOC)
while(all_shared_string_locations)
{