Ignore:
Timestamp:
2004-06-10T15:02:05+12:00 (20 years ago)
Author:
kjdon
Message:

fixed the bug that was causing it not to be able to create a second index using jni - basically had to reset all the static variables at the start of each pass. the tricky thing to find was the static variables in occur_to_lexical in ivf.pass2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/indexers/mg/src/text/ivf.pass1.c

    r3745 r7582  
    4545/*
    4646   $Log$
     47   Revision 1.2  2004/06/10 03:02:05  kjdon
     48   fixed the bug that was causing it not to be able to create a second index using jni - basically had to reset all the static variables at the start of each pass. the tricky thing to find was the static variables in occur_to_lexical in ivf.pass2
     49
    4750   Revision 1.1  2003/02/20 21:18:23  mdewsnip
    4851   Addition of MG package for search and retrieval
     
    123126hash_rec;
    124127
    125 
    126 
    127 
    128 
    129 
    130 
    131 
    132128static unsigned long words_read = 0, words_diff = 0, bytes_diff = 0;
    133129static unsigned long outputbytes = 0;
     
    142138
    143139static hash_rec **HashTable;
    144 static unsigned long HashSize;
    145 static unsigned long HashUsed;
     140static unsigned long HashSize=0;
     141static unsigned long HashUsed=0;
    146142static u_char *Pool;
    147 static int PoolLeft;
     143static int PoolLeft=0;
    148144
    149145static hash_rec *hr_pool;
    150 static int hr_PoolLeft;
     146static int hr_PoolLeft=0;
    151147
    152148static hash_rec **first_occr;
    153 static int max_first_occr;
     149static int max_first_occr=0;
    154150
    155151static mg_ullong L1_bits = 0;
     
    161157static unsigned long callnum = 0, lcallnum = 0, wordnum = 0, lwordnum = 0;
    162158static unsigned long ptrcnt = 0;
    163 static unsigned long checknum;
     159static unsigned long checknum=0;
    164160static long max_mem = 0;
    165161
     
    173169}
    174170
    175 
    176 
     171void
     172ResetStaticI1Vars ()
     173{
     174  words_read = 0;
     175  words_diff = 0;
     176  bytes_diff = 0;
     177  outputbytes = 0;
     178  inputbytes = 0;
     179  MaxMemInUse = 0;
     180  MemInUse = 0;
     181  ChunksWritten = 0;
     182 
     183  HashSize=0;
     184  HashUsed=0;
     185  PoolLeft=0;
     186 
     187  hr_PoolLeft=0;
     188 
     189  max_first_occr=0;
     190 
     191  L1_bits = 0;
     192  L2_bits = 0;
     193  L3_bits = 0;
     194  L1_ohead = 0;
     195  L2_ohead = 0;
     196  L3_ohead = 0;
     197  callnum = 0;
     198  lcallnum = 0;
     199  wordnum = 0;
     200  lwordnum = 0;
     201  ptrcnt = 0;
     202  checknum=0;
     203  max_mem = 0;
     204 
     205}
    177206int
    178207init_ivf_1 (char *file_name)
    179208{
     209  ResetStaticI1Vars();
    180210  if (!(ic = create_file (file_name, INVF_CHUNK_SUFFIX, "wb", MAGIC_CHUNK,
    181211              MG_MESSAGE)))  /* [RPAP - Feb 97: WIN32 Port] */
     
    784814}
    785815
    786 
    787 
    788 
    789816int
    790817done_ivf_1 (char *FileName)
     
    822849  msg_prefix = temp_str;
    823850
     851  /* free the memory */
     852  Xfree(HashTable);
     853  if (Pool) {
     854    Pool -= (POOL_SIZE-PoolLeft);
     855    Xfree(Pool);
     856  }
     857  if (hr_pool) {
     858    hr_pool -= (HASH_POOL_SIZE-hr_PoolLeft);
     859    Xfree(hr_pool);
     860  }
     861  if (first_occr) {
     862    Xfree(first_occr);
     863  }
     864
    824865  return (COMPALLOK);
    825866}               /* done_encode */
Note: See TracChangeset for help on using the changeset viewer.