Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite1bc929

Browse files
committed
Simplify lists for IvfflatScanOpaque [skip ci]
1 parent38285aa commite1bc929

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

‎src/ivfflat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ typedef struct IvfflatScanOpaqueData
278278
pairingheap*listQueue;
279279
BlockNumber*listPages;
280280
intlistIndex;
281-
IvfflatScanListlists[FLEXIBLE_ARRAY_MEMBER];/* must come last */
281+
IvfflatScanList*lists;
282282
}IvfflatScanOpaqueData;
283283

284284
typedefIvfflatScanOpaqueData*IvfflatScanOpaque;

‎src/ivfscan.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ ivfflatbeginscan(Relation index, int nkeys, int norderbys)
280280
if (maxProbes>lists)
281281
maxProbes=lists;
282282

283-
so= (IvfflatScanOpaque)palloc(offsetof(IvfflatScanOpaqueData,lists)+maxProbes*sizeof(IvfflatScanList));
283+
so= (IvfflatScanOpaque)palloc(sizeof(IvfflatScanOpaqueData));
284284
so->typeInfo=IvfflatGetTypeInfo(index);
285285
so->first= true;
286286
so->probes=probes;
@@ -314,6 +314,7 @@ ivfflatbeginscan(Relation index, int nkeys, int norderbys)
314314
so->listQueue=pairingheap_allocate(CompareLists,scan);
315315
so->listPages=palloc(maxProbes*sizeof(BlockNumber));
316316
so->listIndex=0;
317+
so->lists=palloc(maxProbes*sizeof(IvfflatScanList));
317318

318319
scan->opaque=so;
319320

@@ -409,6 +410,7 @@ ivfflatendscan(IndexScanDesc scan)
409410
tuplesort_end(so->sortstate);
410411
FreeAccessStrategy(so->bas);
411412
FreeTupleDesc(so->tupdesc);
413+
pfree(so->lists);
412414

413415
/* TODO Free vslot and mslot without freeing TupleDesc */
414416

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp