Skip to content

Commit 40bad60

Browse files
committed
Minor change in memory contexts usage
1 parent ecf5e82 commit 40bad60

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

hash.c

+1-8
Original file line numberDiff line numberDiff line change
@@ -202,12 +202,12 @@ get_fss_for_object(List *relsigns, List *clauselist,
202202
Assert(n == list_length(selectivities) ||
203203
(nfeatures == NULL && features == NULL));
204204

205-
get_eclasses(clauselist, &nargs, &args_hash, &eclass_hash);
206205
if (nfeatures != NULL)
207206
*features = palloc0(sizeof(**features) * n);
208207

209208
old_ctx_m = MemoryContextSwitchTo(AQOUtilityMemCtx);
210209

210+
get_eclasses(clauselist, &nargs, &args_hash, &eclass_hash);
211211
clause_hashes = palloc(sizeof(*clause_hashes) * n);
212212
clause_has_consts = palloc(sizeof(*clause_has_consts) * n);
213213
sorted_clauses = palloc(sizeof(*sorted_clauses) * n);
@@ -664,19 +664,14 @@ get_eclasses(List *clauselist, int *nargs, int **args_hash, int **eclass_hash)
664664
int i,
665665
v;
666666
int *e_hashes;
667-
MemoryContext old_ctx_m;
668667

669668
get_clauselist_args(clauselist, nargs, args_hash);
670669
*eclass_hash = palloc((*nargs) * sizeof(**eclass_hash));
671670

672-
old_ctx_m = MemoryContextSwitchTo(AQOUtilityMemCtx);
673-
674671
p = perform_eclasses_join(clauselist, *nargs, *args_hash);
675672
lsts = palloc((*nargs) * sizeof(*lsts));
676673
e_hashes = palloc((*nargs) * sizeof(*e_hashes));
677674

678-
MemoryContextSwitchTo(old_ctx_m);
679-
680675
for (i = 0; i < *nargs; ++i)
681676
lsts[i] = NIL;
682677

@@ -690,8 +685,6 @@ get_eclasses(List *clauselist, int *nargs, int **args_hash, int **eclass_hash)
690685

691686
for (i = 0; i < *nargs; ++i)
692687
(*eclass_hash)[i] = e_hashes[disjoint_set_get_parent(p, i)];
693-
694-
MemoryContextReset(AQOUtilityMemCtx);
695688
}
696689

697690
/*

0 commit comments

Comments
 (0)