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

Commitdb3ac67

Browse files
committed
Update comments about memory management.
1 parent5c2abb9 commitdb3ac67

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

‎src/backend/executor/nodeAgg.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,24 @@
2929
* of course). A non-strict finalfunc can make its own choice of
3030
* what to return for a NULL ending transvalue.
3131
*
32+
* When the transvalue datatype is pass-by-reference, we have to be
33+
* careful to ensure that the values survive across tuple cycles yet
34+
* are not allowed to accumulate until end of query. We do this by
35+
* "ping-ponging" between two memory contexts; successive calls to the
36+
* transfunc are executed in alternate contexts, passing the previous
37+
* transvalue that is in the other context. At the beginning of each
38+
* tuple cycle we can reset the current output context to avoid memory
39+
* usage growth. Note: we must use MemoryContextContains() to check
40+
* whether the transfunc has perhaps handed us back one of its input
41+
* values rather than a freshly palloc'd value; if so, we copy the value
42+
* to the context we want it in.
43+
*
3244
*
3345
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
3446
* Portions Copyright (c) 1994, Regents of the University of California
3547
*
3648
* IDENTIFICATION
37-
* $Header: /cvsroot/pgsql/src/backend/executor/nodeAgg.c,v 1.73 2001/01/24 19:42:54 momjian Exp $
49+
* $Header: /cvsroot/pgsql/src/backend/executor/nodeAgg.c,v 1.74 2001/02/15 21:47:08 tgl Exp $
3850
*
3951
*-------------------------------------------------------------------------
4052
*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp