Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: kinosearch: commits

r3874 - in trunk/c_src/KinoSearch: . Analysis Highlight Index Search Store Test

 

 

kinosearch commits RSS feed   Index | Next | Previous | View Threaded


marvin at rectangular

Sep 11, 2008, 10:52 AM

Post #1 of 1 (2607 views)
Permalink
r3874 - in trunk/c_src/KinoSearch: . Analysis Highlight Index Search Store Test

Author: creamyg
Date: 2008-09-11 10:52:23 -0700 (Thu, 11 Sep 2008)
New Revision: 3874

Modified:
trunk/c_src/KinoSearch/Analysis/Analyzer.c
trunk/c_src/KinoSearch/Analysis/PolyAnalyzer.c
trunk/c_src/KinoSearch/Highlight/HeatMap.c
trunk/c_src/KinoSearch/Highlight/Highlighter.c
trunk/c_src/KinoSearch/Index/DelDocs.c
trunk/c_src/KinoSearch/Index/DelEnum.c
trunk/c_src/KinoSearch/Index/FilePurger.c
trunk/c_src/KinoSearch/Index/IndexFileNames.c
trunk/c_src/KinoSearch/Index/PostingsWriter.c
trunk/c_src/KinoSearch/Index/SegInfo.c
trunk/c_src/KinoSearch/Index/Snapshot.c
trunk/c_src/KinoSearch/Index/TermVector.c
trunk/c_src/KinoSearch/Index/TermVectorsReader.c
trunk/c_src/KinoSearch/InvIndex.c
trunk/c_src/KinoSearch/QueryParser.c
trunk/c_src/KinoSearch/Search/MultiSearcher.c
trunk/c_src/KinoSearch/Search/PhraseQuery.c
trunk/c_src/KinoSearch/Search/RangeQuery.c
trunk/c_src/KinoSearch/Search/RequiredOptionalQuery.c
trunk/c_src/KinoSearch/Search/TopDocs.c
trunk/c_src/KinoSearch/Searcher.c
trunk/c_src/KinoSearch/Store/CompoundFileWriter.c
trunk/c_src/KinoSearch/Store/FSFolder.c
trunk/c_src/KinoSearch/Store/RAMFolder.c
trunk/c_src/KinoSearch/Test/TestQueryParserLogic.c
trunk/c_src/KinoSearch/Test/TestQueryParserSyntax.c
Log:
Move around REFCOUNT_DEC calls so that they occur in the opposite order that
the variables were declared. This makes it easier to comment out the middle
of a function when debugging memory leaks.


Modified: trunk/c_src/KinoSearch/Analysis/Analyzer.c
===================================================================
--- trunk/c_src/KinoSearch/Analysis/Analyzer.c 2008-09-11 14:53:51 UTC (rev 3873)
+++ trunk/c_src/KinoSearch/Analysis/Analyzer.c 2008-09-11 17:52:23 UTC (rev 3874)
@@ -18,8 +18,8 @@
Token *seed = Token_new(text->ptr, token_len, 0, token_len, 1.0, 1);
Inversion *starter = Inversion_new(seed);
Inversion *retval = Analyzer_Transform(self, starter);
+ REFCOUNT_DEC(starter);
REFCOUNT_DEC(seed);
- REFCOUNT_DEC(starter);
return retval;
}


Modified: trunk/c_src/KinoSearch/Analysis/PolyAnalyzer.c
===================================================================
--- trunk/c_src/KinoSearch/Analysis/PolyAnalyzer.c 2008-09-11 14:53:51 UTC (rev 3873)
+++ trunk/c_src/KinoSearch/Analysis/PolyAnalyzer.c 2008-09-11 17:52:23 UTC (rev 3874)
@@ -30,9 +30,9 @@
VA_Push(self->analyzers, (Obj*)lc_normalizer);
VA_Push(self->analyzers, (Obj*)tokenizer);
VA_Push(self->analyzers, (Obj*)stemmer);
+ REFCOUNT_DEC(stemmer);
+ REFCOUNT_DEC(tokenizer);
REFCOUNT_DEC(lc_normalizer);
- REFCOUNT_DEC(tokenizer);
- REFCOUNT_DEC(stemmer);
}
else {
CONFESS("Must specify either 'language' or 'analyzers'");

Modified: trunk/c_src/KinoSearch/Highlight/HeatMap.c
===================================================================
--- trunk/c_src/KinoSearch/Highlight/HeatMap.c 2008-09-11 14:53:51 UTC (rev 3873)
+++ trunk/c_src/KinoSearch/Highlight/HeatMap.c 2008-09-11 17:52:23 UTC (rev 3874)
@@ -25,8 +25,9 @@
VA_Push_VArray(spans_plus_boosts, spans_copy);
VA_Sort(spans_plus_boosts, Span_compare);
self->spans = HeatMap_Flatten_Spans(self, spans_plus_boosts);
+
+ REFCOUNT_DEC(spans_plus_boosts);
REFCOUNT_DEC(spans_copy);
- REFCOUNT_DEC(spans_plus_boosts);

return self;
}

Modified: trunk/c_src/KinoSearch/Highlight/Highlighter.c
===================================================================
--- trunk/c_src/KinoSearch/Highlight/Highlighter.c 2008-09-11 14:53:51 UTC (rev 3873)
+++ trunk/c_src/KinoSearch/Highlight/Highlighter.c 2008-09-11 17:52:23 UTC (rev 3874)
@@ -122,11 +122,11 @@
Highlighter_highlight_excerpt(self, score_spans, raw_excerpt,
highlighted, top);

+ REFCOUNT_DEC(sentences);
+ REFCOUNT_DEC(heat_map);
+ REFCOUNT_DEC(score_spans);
REFCOUNT_DEC(doc_vec);
- REFCOUNT_DEC(score_spans);
- REFCOUNT_DEC(heat_map);
REFCOUNT_DEC(raw_excerpt);
- REFCOUNT_DEC(sentences);

return highlighted;
}
@@ -388,8 +388,8 @@
hl_frag = Highlighter_Highlight(self, encoded);
CB_Cat(highlighted, hl_frag);
ZCB_Nip(&temp, highlighted_len);
+ REFCOUNT_DEC(hl_frag);
REFCOUNT_DEC(encoded);
- REFCOUNT_DEC(hl_frag);
}
last_end = relative_end;
}

Modified: trunk/c_src/KinoSearch/Index/DelDocs.c
===================================================================
--- trunk/c_src/KinoSearch/Index/DelDocs.c 2008-09-11 14:53:51 UTC (rev 3873)
+++ trunk/c_src/KinoSearch/Index/DelDocs.c 2008-09-11 17:52:23 UTC (rev 3874)
@@ -80,8 +80,8 @@
InStream_Close(instream);

/* Clean up. */
+ REFCOUNT_DEC(instream);
REFCOUNT_DEC(filename);
- REFCOUNT_DEC(instream);
}
}
}

Modified: trunk/c_src/KinoSearch/Index/DelEnum.c
===================================================================
--- trunk/c_src/KinoSearch/Index/DelEnum.c 2008-09-11 14:53:51 UTC (rev 3873)
+++ trunk/c_src/KinoSearch/Index/DelEnum.c 2008-09-11 17:52:23 UTC (rev 3874)
@@ -29,9 +29,9 @@

DelEnum_init2(self, bit_vectors, seg_starts, IxReader_Max_Docs(reader));

+ REFCOUNT_DEC(bit_vectors);
+ REFCOUNT_DEC(seg_starts);
REFCOUNT_DEC(seg_readers);
- REFCOUNT_DEC(seg_starts);
- REFCOUNT_DEC(bit_vectors);
return self;
}


Modified: trunk/c_src/KinoSearch/Index/FilePurger.c
===================================================================
--- trunk/c_src/KinoSearch/Index/FilePurger.c 2008-09-11 14:53:51 UTC (rev 3873)
+++ trunk/c_src/KinoSearch/Index/FilePurger.c 2008-09-11 17:52:23 UTC (rev 3874)
@@ -115,8 +115,8 @@
}

unused = IxFileNames_unused_files(files, snapshots);
+ REFCOUNT_DEC(snapshots);
REFCOUNT_DEC(files);
- REFCOUNT_DEC(snapshots);
return unused;
}


Modified: trunk/c_src/KinoSearch/Index/IndexFileNames.c
===================================================================
--- trunk/c_src/KinoSearch/Index/IndexFileNames.c 2008-09-11 14:53:51 UTC (rev 3873)
+++ trunk/c_src/KinoSearch/Index/IndexFileNames.c 2008-09-11 17:52:23 UTC (rev 3874)
@@ -166,9 +166,9 @@
}

/* Clean up. */
+ REFCOUNT_DEC(gen_files);
REFCOUNT_DEC(active_segs);
REFCOUNT_DEC(keepers);
- REFCOUNT_DEC(gen_files);

return unused;
}

Modified: trunk/c_src/KinoSearch/Index/PostingsWriter.c
===================================================================
--- trunk/c_src/KinoSearch/Index/PostingsWriter.c 2008-09-11 14:53:51 UTC (rev 3873)
+++ trunk/c_src/KinoSearch/Index/PostingsWriter.c 2008-09-11 17:52:23 UTC (rev 3874)
@@ -334,8 +334,8 @@
}

/* Clean up. */
+ REFCOUNT_DEC(last_term_text);
REFCOUNT_DEC(tinfo);
- REFCOUNT_DEC(last_term_text);
}

static void
@@ -383,8 +383,8 @@
/* Finish and clean up. */
LexWriter_Finish_Field(self->lex_writer, field_num);
OutStream_Close(post_stream);
+ REFCOUNT_DEC(filename);
REFCOUNT_DEC(post_stream);
- REFCOUNT_DEC(filename);
}

/* Clean up. */

Modified: trunk/c_src/KinoSearch/Index/SegInfo.c
===================================================================
--- trunk/c_src/KinoSearch/Index/SegInfo.c 2008-09-11 14:53:51 UTC (rev 3873)
+++ trunk/c_src/KinoSearch/Index/SegInfo.c 2008-09-11 17:52:23 UTC (rev 3874)
@@ -135,6 +135,7 @@
Hash_Store_Str(seg_info_metadata, "seg_name", 8, (Obj*)seg_name_copy);
Hash_Store_Str(seg_info_metadata, "field_names", 11, (Obj*)self->by_num);
Hash_Store_Str(self->metadata, "seg_info", 8, (Obj*)seg_info_metadata);
+
REFCOUNT_DEC(seg_name_copy);
REFCOUNT_DEC(seg_info_metadata);


Modified: trunk/c_src/KinoSearch/Index/Snapshot.c
===================================================================
--- trunk/c_src/KinoSearch/Index/Snapshot.c 2008-09-11 14:53:51 UTC (rev 3873)
+++ trunk/c_src/KinoSearch/Index/Snapshot.c 2008-09-11 17:52:23 UTC (rev 3874)
@@ -222,9 +222,9 @@

/* Clean up. */
REFCOUNT_DEC(filename);
- REFCOUNT_DEC(all_data);
REFCOUNT_DEC(segments);
REFCOUNT_DEC(fields);
+ REFCOUNT_DEC(all_data);
}

/* Copyright 2006-2008 Marvin Humphrey

Modified: trunk/c_src/KinoSearch/Index/TermVector.c
===================================================================
--- trunk/c_src/KinoSearch/Index/TermVector.c 2008-09-11 14:53:51 UTC (rev 3873)
+++ trunk/c_src/KinoSearch/Index/TermVector.c 2008-09-11 17:52:23 UTC (rev 3874)
@@ -87,11 +87,11 @@
self = self ? self : (TermVector*)CREATE(NULL, TERMVECTOR);
self = TV_init(self, field, text, positions, start_offsets, end_offsets);

- REFCOUNT_DEC(field);
- REFCOUNT_DEC(text);
REFCOUNT_DEC(positions);
REFCOUNT_DEC(start_offsets);
REFCOUNT_DEC(end_offsets);
+ REFCOUNT_DEC(text);
+ REFCOUNT_DEC(field);

return self;
}

Modified: trunk/c_src/KinoSearch/Index/TermVectorsReader.c
===================================================================
--- trunk/c_src/KinoSearch/Index/TermVectorsReader.c 2008-09-11 14:53:51 UTC (rev 3873)
+++ trunk/c_src/KinoSearch/Index/TermVectorsReader.c 2008-09-11 17:52:23 UTC (rev 3874)
@@ -72,8 +72,8 @@
CharBuf *field = CB_deserialize(NULL, self->tv_in);
ByteBuf *field_buf = BB_deserialize(NULL, self->tv_in);
DocVec_Add_Field_Buf(doc_vec, field, field_buf);
+ REFCOUNT_DEC(field_buf);
REFCOUNT_DEC(field);
- REFCOUNT_DEC(field_buf);
}

return doc_vec;

Modified: trunk/c_src/KinoSearch/InvIndex.c
===================================================================
--- trunk/c_src/KinoSearch/InvIndex.c 2008-09-11 14:53:51 UTC (rev 3873)
+++ trunk/c_src/KinoSearch/InvIndex.c 2008-09-11 17:52:23 UTC (rev 3874)
@@ -107,8 +107,8 @@
CharBuf *filename = (CharBuf*)VA_Fetch(kino_files, i);
Folder_Delete_Real_File(self->folder, filename);
}
+ REFCOUNT_DEC(kino_files);
REFCOUNT_DEC(all_files);
- REFCOUNT_DEC(kino_files);
init_invindex_files(self);

return self;

Modified: trunk/c_src/KinoSearch/QueryParser.c
===================================================================
--- trunk/c_src/KinoSearch/QueryParser.c 2008-09-11 14:53:51 UTC (rev 3873)
+++ trunk/c_src/KinoSearch/QueryParser.c 2008-09-11 17:52:23 UTC (rev 3874)
@@ -190,9 +190,9 @@
Query *tree = QParser_tree(self, qstring);
Query *expanded = QParser_expand(self, tree);
Query *pruned = QParser_prune(self, expanded);
+ REFCOUNT_DEC(expanded);
+ REFCOUNT_DEC(tree);
REFCOUNT_DEC(qstring);
- REFCOUNT_DEC(tree);
- REFCOUNT_DEC(expanded);
return pruned;
}

@@ -203,8 +203,8 @@
CharBuf *mod1 = extract_phrases(self, query_string, extractions);
CharBuf *mod2 = extract_paren_groups(self, mod1, extractions);
Query *retval = do_tree(self, mod2, NULL, extractions);
+ REFCOUNT_DEC(mod2);
REFCOUNT_DEC(mod1);
- REFCOUNT_DEC(mod2);
REFCOUNT_DEC(extractions);
return retval;
}
@@ -347,8 +347,8 @@
ParserClause *clause = ParserClause_new(query, default_occur);
Hash_Delete(extractions, token->text);
VA_Store(elems, i, (Obj*)clause);
+ REFCOUNT_DEC(clause);
REFCOUNT_DEC(query);
- REFCOUNT_DEC(clause);
}
/* Recursively parse parenthetical groupings. */
else if (CB_Starts_With(token->text, self->bool_group_label)) {
@@ -360,8 +360,8 @@
ParserClause *clause
= ParserClause_new(query, default_occur);
VA_Store(elems, i, (Obj*)clause);
+ REFCOUNT_DEC(clause);
REFCOUNT_DEC(query);
- REFCOUNT_DEC(clause);
}
}
/* What's left is probably a term, so generate a LeafQuery. */
@@ -369,8 +369,8 @@
Query *query = (Query*)LeafQuery_new(field, token->text);
ParserClause *clause = ParserClause_new(query, default_occur);
VA_Store(elems, i, (Obj*)clause);
+ REFCOUNT_DEC(clause);
REFCOUNT_DEC(query);
- REFCOUNT_DEC(clause);
}
}
}
@@ -618,11 +618,11 @@
CONFESS("Unexpected error");
}

+ REFCOUNT_DEC(opt_query);
REFCOUNT_DEC(req_query);
- REFCOUNT_DEC(opt_query);
+ REFCOUNT_DEC(negated);
+ REFCOUNT_DEC(optional);
REFCOUNT_DEC(required);
- REFCOUNT_DEC(optional);
- REFCOUNT_DEC(negated);
}

REFCOUNT_DEC(elems);
@@ -855,8 +855,8 @@
else if (opt_query) retval = REFCOUNT_INC(opt_query);
else retval = (Query*)NoMatchQuery_new();

+ REFCOUNT_DEC(opt_query);
REFCOUNT_DEC(req_query);
- REFCOUNT_DEC(opt_query);
}
else {
retval = REFCOUNT_INC(query);
@@ -943,8 +943,8 @@
REFCOUNT_DEC(term_query);
}

+ REFCOUNT_DEC(token_texts);
REFCOUNT_DEC(maybe_texts);
- REFCOUNT_DEC(token_texts);
}
}

@@ -965,8 +965,8 @@
}

/* Clean up. */
+ REFCOUNT_DEC(queries);
REFCOUNT_DEC(fields);
- REFCOUNT_DEC(queries);

return retval;
}

Modified: trunk/c_src/KinoSearch/Search/MultiSearcher.c
===================================================================
--- trunk/c_src/KinoSearch/Search/MultiSearcher.c 2008-09-11 14:53:51 UTC (rev 3873)
+++ trunk/c_src/KinoSearch/Search/MultiSearcher.c 2008-09-11 17:52:23 UTC (rev 3874)
@@ -206,8 +206,8 @@
}

retval = TopDocs_new(score_docs, total_hits, max_score);
+ REFCOUNT_DEC(score_docs);
REFCOUNT_DEC(compiler);
- REFCOUNT_DEC(score_docs);
REFCOUNT_DEC(hit_q);
return retval;
}

Modified: trunk/c_src/KinoSearch/Search/PhraseQuery.c
===================================================================
--- trunk/c_src/KinoSearch/Search/PhraseQuery.c 2008-09-11 14:53:51 UTC (rev 3873)
+++ trunk/c_src/KinoSearch/Search/PhraseQuery.c 2008-09-11 17:52:23 UTC (rev 3874)
@@ -394,10 +394,9 @@
REFCOUNT_DEC(valid_posits);
}

- REFCOUNT_DEC(term_vectors);
- REFCOUNT_DEC(posit_vec);
REFCOUNT_DEC(other_posit_vec);
-
+ REFCOUNT_DEC(posit_vec);
+ REFCOUNT_DEC(term_vectors);
return spans;
}


Modified: trunk/c_src/KinoSearch/Search/RangeQuery.c
===================================================================
--- trunk/c_src/KinoSearch/Search/RangeQuery.c 2008-09-11 14:53:51 UTC (rev 3873)
+++ trunk/c_src/KinoSearch/Search/RangeQuery.c 2008-09-11 17:52:23 UTC (rev 3874)
@@ -95,8 +95,8 @@
upper_term_str,
self->include_upper ? "]" : "}"
);
- REFCOUNT_DEC(lower_term_str);
REFCOUNT_DEC(upper_term_str);
+ REFCOUNT_DEC(lower_term_str);
return retval;
}

@@ -140,11 +140,9 @@
include_upper);
RangeQuery_Set_Boost(self, boost);

- /* Clean up. */
- REFCOUNT_DEC(field);
- REFCOUNT_DEC(lower_term);
REFCOUNT_DEC(upper_term);
-
+ REFCOUNT_DEC(lower_term);
+ REFCOUNT_DEC(field);
return self;
}


Modified: trunk/c_src/KinoSearch/Search/RequiredOptionalQuery.c
===================================================================
--- trunk/c_src/KinoSearch/Search/RequiredOptionalQuery.c 2008-09-11 14:53:51 UTC (rev 3873)
+++ trunk/c_src/KinoSearch/Search/RequiredOptionalQuery.c 2008-09-11 17:52:23 UTC (rev 3874)
@@ -66,8 +66,8 @@
CharBuf *req_string = Obj_To_String(VA_Fetch(self->children, 0));
CharBuf *opt_string = Obj_To_String(VA_Fetch(self->children, 1));
CharBuf *retval = CB_newf("(+%o %o)", req_string, opt_string);
+ REFCOUNT_DEC(opt_string);
REFCOUNT_DEC(req_string);
- REFCOUNT_DEC(opt_string);
return retval;
}

@@ -120,8 +120,8 @@
}
else {
Scorer *retval = (Scorer*)ReqOptScorer_new(sim, req_scorer, opt_scorer);
+ REFCOUNT_DEC(opt_scorer);
REFCOUNT_DEC(req_scorer);
- REFCOUNT_DEC(opt_scorer);
return retval;
}
}

Modified: trunk/c_src/KinoSearch/Search/TopDocs.c
===================================================================
--- trunk/c_src/KinoSearch/Search/TopDocs.c 2008-09-11 14:53:51 UTC (rev 3873)
+++ trunk/c_src/KinoSearch/Search/TopDocs.c 2008-09-11 17:52:23 UTC (rev 3874)
@@ -90,8 +90,8 @@
remote_doc = RemoteFieldDoc_new(field_doc->doc_num,
field_doc->score, field_vals);
VA_Push(remote_docs, (Obj*)remote_doc);
+ REFCOUNT_DEC(remote_doc);
REFCOUNT_DEC(field_vals);
- REFCOUNT_DEC(remote_doc);
}

TopDocs_Set_Score_Docs(self, remote_docs);

Modified: trunk/c_src/KinoSearch/Searcher.c
===================================================================
--- trunk/c_src/KinoSearch/Searcher.c 2008-09-11 14:53:51 UTC (rev 3873)
+++ trunk/c_src/KinoSearch/Searcher.c 2008-09-11 17:52:23 UTC (rev 3874)
@@ -108,8 +108,8 @@
}

retval = TopDocs_new(score_docs, collector->total_hits, max_score);
+ REFCOUNT_DEC(score_docs);
REFCOUNT_DEC(collector);
- REFCOUNT_DEC(score_docs);
return retval;
}

@@ -137,8 +137,8 @@
hits_per_seg, seg_starts);
}

+ REFCOUNT_DEC(scorer);
REFCOUNT_DEC(compiler);
- REFCOUNT_DEC(scorer);
REFCOUNT_DEC(seg_starts);
}


Modified: trunk/c_src/KinoSearch/Store/CompoundFileWriter.c
===================================================================
--- trunk/c_src/KinoSearch/Store/CompoundFileWriter.c 2008-09-11 14:53:51 UTC (rev 3873)
+++ trunk/c_src/KinoSearch/Store/CompoundFileWriter.c 2008-09-11 17:52:23 UTC (rev 3874)
@@ -133,8 +133,8 @@
Hash_Store_I64(file_data, "length", 6, len);
Hash_Store(sub_files, infilename, (Obj*)file_data);

+ REFCOUNT_DEC(instream);
REFCOUNT_DEC(file_data);
- REFCOUNT_DEC(instream);
}
}

@@ -168,8 +168,8 @@
Folder_Rename_File(self->folder, outfilename, commit_filename);

/* Clean up. */
+ REFCOUNT_DEC(commit_filename);
REFCOUNT_DEC(outfilename);
- REFCOUNT_DEC(commit_filename);
}

/* Copyright 2007-2008 Marvin Humphrey

Modified: trunk/c_src/KinoSearch/Store/FSFolder.c
===================================================================
--- trunk/c_src/KinoSearch/Store/FSFolder.c 2008-09-11 14:53:51 UTC (rev 3873)
+++ trunk/c_src/KinoSearch/Store/FSFolder.c 2008-09-11 17:52:23 UTC (rev 3874)
@@ -133,8 +133,8 @@
CONFESS("rename from '%o' to '%o' failed: %s", from_path, to_path,
strerror(errno));
}
+ REFCOUNT_DEC(to_path);
REFCOUNT_DEC(from_path);
- REFCOUNT_DEC(to_path);
}

void

Modified: trunk/c_src/KinoSearch/Store/RAMFolder.c
===================================================================
--- trunk/c_src/KinoSearch/Store/RAMFolder.c 2008-09-11 14:53:51 UTC (rev 3873)
+++ trunk/c_src/KinoSearch/Store/RAMFolder.c 2008-09-11 17:52:23 UTC (rev 3874)
@@ -41,10 +41,10 @@
= FSFolder_Open_InStream(source_folder, filename);
OutStream *outstream = RAMFolder_Open_OutStream(self, filename);
OutStream_Absorb(outstream, source_stream);
+ OutStream_Close(outstream);
InStream_Close(source_stream);
- OutStream_Close(outstream);
+ REFCOUNT_DEC(outstream);
REFCOUNT_DEC(source_stream);
- REFCOUNT_DEC(outstream);
}

REFCOUNT_DEC(files);

Modified: trunk/c_src/KinoSearch/Test/TestQueryParserLogic.c
===================================================================
--- trunk/c_src/KinoSearch/Test/TestQueryParserLogic.c 2008-09-11 14:53:51 UTC (rev 3873)
+++ trunk/c_src/KinoSearch/Test/TestQueryParserLogic.c 2008-09-11 17:52:23 UTC (rev 3874)
@@ -258,8 +258,8 @@
}
else {
tree = (Query*)ReqOptQuery_new(b_query, a_query);
+ REFCOUNT_DEC(b_query);
REFCOUNT_DEC(a_query);
- REFCOUNT_DEC(b_query);
}
return TestQP_new("a +b", tree, NULL, 3);
}
@@ -397,8 +397,8 @@
}
else {
tree = (Query*)ReqOptQuery_new(d_query, ab_query);
+ REFCOUNT_DEC(d_query);
REFCOUNT_DEC(ab_query);
- REFCOUNT_DEC(d_query);
}
UNUSED_VAR(boolop);
return TestQP_new("\"a b\" +d", tree, NULL, 1);
@@ -503,9 +503,9 @@
Query *tree = (Query*)ReqOptQuery_new(a_leaf, not_b);
Query *nomatch = (Query*)NoMatchQuery_new();
Query *pruned = (Query*)ReqOptQuery_new(a_leaf, nomatch);
+ REFCOUNT_DEC(nomatch);
+ REFCOUNT_DEC(not_b);
REFCOUNT_DEC(a_leaf);
- REFCOUNT_DEC(not_b);
- REFCOUNT_DEC(nomatch);
return TestQP_new(NULL, tree, pruned, 4);
}

@@ -518,9 +518,9 @@
Query *tree = (Query*)ReqOptQuery_new(not_a, b_leaf);
Query *nomatch = (Query*)NoMatchQuery_new();
Query *pruned = (Query*)ReqOptQuery_new(nomatch, b_leaf);
+ REFCOUNT_DEC(nomatch);
REFCOUNT_DEC(not_a);
REFCOUNT_DEC(b_leaf);
- REFCOUNT_DEC(nomatch);
return TestQP_new(NULL, tree, pruned, 0);
}

@@ -690,9 +690,9 @@
"tree() OR %s", test_case->query_string->ptr);
ASSERT_INT_EQ(batch, Hits_Total_Hits(hits), test_case->num_hits,
"hits: OR %s", test_case->query_string->ptr);
+ REFCOUNT_DEC(hits);
+ REFCOUNT_DEC(parsed);
REFCOUNT_DEC(tree);
- REFCOUNT_DEC(parsed);
- REFCOUNT_DEC(hits);
REFCOUNT_DEC(test_case);
}

@@ -709,9 +709,9 @@
"tree() AND %s", test_case->query_string->ptr);
ASSERT_INT_EQ(batch, Hits_Total_Hits(hits), test_case->num_hits,
"hits: AND %s", test_case->query_string->ptr);
+ REFCOUNT_DEC(hits);
+ REFCOUNT_DEC(parsed);
REFCOUNT_DEC(tree);
- REFCOUNT_DEC(parsed);
- REFCOUNT_DEC(hits);
REFCOUNT_DEC(test_case);
}

@@ -735,18 +735,18 @@
ASSERT_INT_EQ(batch, Hits_Total_Hits(hits), test_case->num_hits,
"hits: %s", qstring->ptr);

+ REFCOUNT_DEC(hits);
+ REFCOUNT_DEC(expanded);
REFCOUNT_DEC(pruned);
- REFCOUNT_DEC(expanded);
REFCOUNT_DEC(qstring);
- REFCOUNT_DEC(hits);
REFCOUNT_DEC(test_case);
}

- batch->destroy(batch);
+ REFCOUNT_DEC(and_parser);
+ REFCOUNT_DEC(or_parser);
REFCOUNT_DEC(searcher);
- REFCOUNT_DEC(or_parser);
- REFCOUNT_DEC(and_parser);
REFCOUNT_DEC(invindex);
+ batch->destroy(batch);
}
/* Copyright 2005-2008 Marvin Humphrey
*

Modified: trunk/c_src/KinoSearch/Test/TestQueryParserSyntax.c
===================================================================
--- trunk/c_src/KinoSearch/Test/TestQueryParserSyntax.c 2008-09-11 14:53:51 UTC (rev 3873)
+++ trunk/c_src/KinoSearch/Test/TestQueryParserSyntax.c 2008-09-11 17:52:23 UTC (rev 3874)
@@ -233,9 +233,9 @@
"expand_leaf() %s", test_case->query_string->ptr);
ASSERT_INT_EQ(batch, Hits_Total_Hits(hits), test_case->num_hits,
"hits: %s", test_case->query_string->ptr);
+ REFCOUNT_DEC(hits);
+ REFCOUNT_DEC(parsed);
REFCOUNT_DEC(tree);
- REFCOUNT_DEC(parsed);
- REFCOUNT_DEC(hits);
REFCOUNT_DEC(test_case);
}

@@ -250,9 +250,9 @@
"tree() %s", test_case->query_string->ptr);
ASSERT_INT_EQ(batch, Hits_Total_Hits(hits), test_case->num_hits,
"hits: %s", test_case->query_string->ptr);
+ REFCOUNT_DEC(hits);
+ REFCOUNT_DEC(parsed);
REFCOUNT_DEC(tree);
- REFCOUNT_DEC(parsed);
- REFCOUNT_DEC(hits);
REFCOUNT_DEC(test_case);
}



_______________________________________________
kinosearch-commits mailing list
kinosearch-commits [at] rectangular
http://www.rectangular.com/mailman/listinfo/kinosearch-commits

kinosearch commits RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.