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

Commite57e991

Browse files
committed
Improve comments for SearchSysCacheTuple and SearchSysCacheTupleCopy.
1 parent05cd91a commite57e991

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

‎src/backend/utils/cache/syscache.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.50 2000/04/12 17:15:54 momjian Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/utils/cache/syscache.c,v 1.51 2000/06/06 17:02:38 tgl Exp $
1212
*
1313
* NOTES
1414
* These routines allow the parser/planner/executor to perform
@@ -456,8 +456,10 @@ InitCatalogCache()
456456
/*
457457
* SearchSysCacheTupleCopy
458458
*
459-
*This is like SearchSysCacheTuple, except it returns a copy of the tuple
460-
*that the user is required to pfree().
459+
*This is like SearchSysCacheTuple, except it returns a palloc'd copy of
460+
*the tuple. The caller should heap_freetuple() the returned copy when
461+
*done with it. This routine should be used when the caller intends to
462+
*continue to access the tuple for more than a very short period of time.
461463
*/
462464
HeapTuple
463465
SearchSysCacheTupleCopy(intcacheId,/* cache selection code */
@@ -485,7 +487,11 @@ SearchSysCacheTupleCopy(int cacheId,/* cache selection code */
485487
*Returns the cache copy of the tuple if one is found, NULL if not.
486488
*The tuple is the 'cache' copy.
487489
*
488-
*XXX The tuple that is returned is NOT supposed to be pfree'd!
490+
*CAUTION: The tuple that is returned must NOT be freed by the caller!
491+
*
492+
*CAUTION: The returned tuple may be flushed from the cache during
493+
*subsequent cache lookup operations, or by shared cache invalidation.
494+
*Callers should not expect the pointer to remain valid for long.
489495
*/
490496
HeapTuple
491497
SearchSysCacheTuple(intcacheId,/* cache selection code */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp