comparison index.cpp @ 512:6439cfba2524 memory-leaks

Implemented correct LSH table via compile-time switch -DLSH_DUMP_CORE_TABLES. Dumps on LSH load.
author mas01mc
date Fri, 23 Jan 2009 18:45:44 +0000
parents 920919d62542
children
comparison
equal deleted inserted replaced
502:eb9a7ef110c1 512:6439cfba2524
214 lsh = new LSH(mergeIndexName, false); // Initialize empty LSH tables 214 lsh = new LSH(mergeIndexName, false); // Initialize empty LSH tables
215 assert(lsh); 215 assert(lsh);
216 216
217 // Insert up to lsh_param_b database tracks 217 // Insert up to lsh_param_b database tracks
218 index_insert_tracks(startTrack, endTrack, &fvp, &sNorm, &snPtr, &sPower, &spPtr); 218 index_insert_tracks(startTrack, endTrack, &fvp, &sNorm, &snPtr, &sPower, &spPtr);
219 219
220 // Serialize to file (merging is performed here) 220 // Serialize to file (merging is performed here)
221 lsh->serialize(mergeIndexName, lsh_in_core?O2_SERIAL_FILEFORMAT2:O2_SERIAL_FILEFORMAT1); // Serialize core LSH heap to disk 221 lsh->serialize(mergeIndexName, lsh_in_core?O2_SERIAL_FILEFORMAT2:O2_SERIAL_FILEFORMAT1); // Serialize core LSH heap to disk
222 delete lsh; 222 delete lsh;
223 lsh = 0; 223 lsh = 0;
224 } 224 }
225 225
226 close(lshfid); 226 close(lshfid);
504 if(SERVER_LSH_INDEX_SINGLETON) 504 if(SERVER_LSH_INDEX_SINGLETON)
505 fprintf(stderr,"INDEX: using persistent hash tables: %s\n", lsh->get_indexName()); 505 fprintf(stderr,"INDEX: using persistent hash tables: %s\n", lsh->get_indexName());
506 else 506 else
507 VERB_LOG(1,"INDEX: loading hash tables into core %s\n", (lsh->get_lshHeader()->flags&O2_SERIAL_FILEFORMAT2)?"FORMAT2":"FORMAT1"); 507 VERB_LOG(1,"INDEX: loading hash tables into core %s\n", (lsh->get_lshHeader()->flags&O2_SERIAL_FILEFORMAT2)?"FORMAT2":"FORMAT1");
508 lsh = index_allocate(indexName, true); 508 lsh = index_allocate(indexName, true);
509 #ifdef LSH_DUMP_CORE_TABLES
510 lsh->dump_hashtables();
511 #endif
509 } 512 }
510 513
511 delete[] indexName; 514 delete[] indexName;
512 return true; 515 return true;
513 } 516 }