pike.git / src / stralloc.c

version» Context lines:

pike.git/src/stralloc.c:8:   #include "pike_macros.h"   #include "dynamic_buffer.h"   #include "pike_macros.h"   #include "pike_memory.h"   #include "error.h"   #include "gc.h"   #include "stuff.h"      #include <ctype.h>    - RCSID("$Id: stralloc.c,v 1.52 1998/12/20 09:24:26 hubbe Exp $"); + RCSID("$Id: stralloc.c,v 1.53 1999/02/01 02:41:48 hubbe Exp $");      #define BEGIN_HASH_SIZE 997   #define MAX_AVG_LINK_LENGTH 3   #define HASH_PREFIX 64      unsigned INT32 htable_size=0;   static unsigned int hashprimes_entry=0;   static struct pike_string **base_table=0;   static unsigned INT32 full_hash_value;   unsigned INT32 num_strings=0;
pike.git/src/stralloc.c:651:    int num_distinct_strings=0;    int bytes_distinct_strings=0;    int overhead_bytes=0;    unsigned INT32 e;    struct pike_string *p;    for(e=0;e<htable_size;e++)    {    for(p=base_table[e];p;p=p->next)    {    num_distinct_strings++; -  bytes_distinct_strings+=MY_ALIGN(p->len); +  bytes_distinct_strings+=DO_ALIGN(p->len,sizeof(void *));    allocd_strings+=p->refs; -  allocd_bytes+=p->refs*MY_ALIGN(p->len+3); +  allocd_bytes+=p->refs*DO_ALIGN(p->len+3,sizeof(void *));    }       }    overhead_bytes=(sizeof(struct pike_string)-1)*num_distinct_strings;    my_strcat("\nShared string hash table:\n");    my_strcat("-------------------------\t Strings Bytes\n");       sprintf(b,"Total asked for\t\t\t%8ld %8ld\n",    (long)allocd_strings, (long)allocd_bytes);    my_strcat(b);