Branch: Tag:

2001-09-05

2001-09-05 01:42:47 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

speed up do_debug() a bit by avoiding duplicate checks in stralloc

Rev: src/backend.cmod:1.17
Rev: src/stralloc.c:1.133

27:   #define HUGE HUGE_VAL   #endif /*!HUGE*/    - RCSID("$Id: stralloc.c,v 1.132 2001/09/04 19:26:54 mast Exp $"); + RCSID("$Id: stralloc.c,v 1.133 2001/09/05 01:42:47 hubbe Exp $");      #if PIKE_RUN_UNLOCKED   /* Make this bigger when we get lightweight threads */
1003: Inside #if defined(PIKE_DEBUG)
  /*** PIKE_DEBUG ***/   #ifdef PIKE_DEBUG    + static long last_stralloc_verify=0; + extern long current_do_debug_cycle; +    PMOD_EXPORT void check_string(struct pike_string *s)   { -  +  if(current_do_debug_cycle == last_stralloc_verify) +  { +  if(debug_findstring(s) !=s) +  fatal("Shared string not shared.\n"); +  }else{    if(do_hash(s) != s->hval)    {    locate_problem(wrong_hash);
1020: Inside #if defined(PIKE_DEBUG)
   fatal("Shared string is not zero terminated properly.\n");    }   } + }      PMOD_EXPORT void verify_shared_strings_tables(void)   {    unsigned INT32 e, h, num=0;    struct pike_string *s;    -  +  last_stralloc_verify=current_do_debug_cycle; +     for(e=0;e<htable_size;e++)    {    h=0;