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

Commit8a50352

Browse files
committed
pg_buffercache: Allow huge allocations.
Otherwise, users who have configured shared_buffers >= 256GB won'tbe able to use this module. There probably aren't many of those, butit doesn't hurt anything to fix it so that it works.Backpatch to 9.4, where MemoryContextAllocHuge was introduced. Thesame problem exists in older branches, but there's no easy way tofix it there.KaiGai Kohei
1 parent593d4e4 commit8a50352

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎contrib/pg_buffercache/pg_buffercache_pages.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ pg_buffercache_pages(PG_FUNCTION_ARGS)
124124
fctx->tupdesc=BlessTupleDesc(tupledesc);
125125

126126
/* Allocate NBuffers worth of BufferCachePagesRec records. */
127-
fctx->record= (BufferCachePagesRec*)palloc(sizeof(BufferCachePagesRec)*NBuffers);
127+
fctx->record= (BufferCachePagesRec*)
128+
MemoryContextAllocHuge(CurrentMemoryContext,
129+
sizeof(BufferCachePagesRec)*NBuffers);
128130

129131
/* Set max calls and remember the user function context. */
130132
funcctx->max_calls=NBuffers;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp