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

Commit7ea9b99

Browse files
committed
Remove unnecessary coziness of GIN code with datum copying. Now that
space is tracked via GetMemoryChunkSpace, there's really no advantageto duplicating datumCopy's innards here. This is one bit of my toastindirection patch that should go in anyway.
1 parent4a8d573 commit7ea9b99

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

‎src/backend/access/gin/ginbulk.c

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
1010
* IDENTIFICATION
11-
*$PostgreSQL: pgsql/src/backend/access/gin/ginbulk.c,v 1.11 2008/01/01 19:45:46 momjian Exp $
11+
*$PostgreSQL: pgsql/src/backend/access/gin/ginbulk.c,v 1.12 2008/06/29 21:04:01 tgl Exp $
1212
*-------------------------------------------------------------------------
1313
*/
1414

@@ -78,8 +78,8 @@ ginInsertData(BuildAccumulator *accum, EntryAccumulator *entry, ItemPointer heap
7878
}
7979

8080
/*
81-
* This is basically the same as datumCopy(), butwe duplicate some code
82-
*to avoid computing the datum size twice.
81+
* This is basically the same as datumCopy(), butmodified to count
82+
*palloc'd space in accum.
8383
*/
8484
staticDatum
8585
getDatumCopy(BuildAccumulator*accum,Datumvalue)
@@ -91,16 +91,8 @@ getDatumCopy(BuildAccumulator *accum, Datum value)
9191
res=value;
9292
else
9393
{
94-
SizerealSize;
95-
char*s;
96-
97-
realSize=datumGetSize(value, false,att[0]->attlen);
98-
99-
s= (char*)palloc(realSize);
100-
accum->allocatedMemory+=GetMemoryChunkSpace(s);
101-
102-
memcpy(s,DatumGetPointer(value),realSize);
103-
res=PointerGetDatum(s);
94+
res=datumCopy(value, false,att[0]->attlen);
95+
accum->allocatedMemory+=GetMemoryChunkSpace(DatumGetPointer(res));
10496
}
10597
returnres;
10698
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp