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

Commit490e9a9

Browse files
committed
Fix two valgrind issues in slab allocator.
During allocation VALGRIND_MAKE_MEM_DEFINED was called with a pointeras size. That kind of works, but makes valgrind exceedingly slow forworkloads involving the slab allocator.Secondly there was an access to memory marked as unreachable withinSlabCheck(). Fix that too.Author: Tomas VondraDiscussion:https://postgr.es/m/a6543b6d-6015-99b1-63ef-3ed55a76a730@2ndquadrant.com
1 parente75a786 commit490e9a9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎src/backend/utils/mmgr/slab.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ SlabAlloc(MemoryContext context, Size size)
403403
* Remove the chunk from the freelist head. The index of the next free
404404
* chunk is stored in the chunk itself.
405405
*/
406-
VALGRIND_MAKE_MEM_DEFINED(chunk,SlabChunkGetPointer(chunk));
406+
VALGRIND_MAKE_MEM_DEFINED(SlabChunkGetPointer(chunk),sizeof(int32));
407407
block->firstFreeChunk=*(int32*)SlabChunkGetPointer(chunk);
408408

409409
Assert(block->firstFreeChunk >=0);
@@ -725,6 +725,7 @@ SlabCheck(MemoryContext context)
725725

726726
/* read index of the next free chunk */
727727
chunk=SlabBlockGetChunk(slab,block,idx);
728+
VALGRIND_MAKE_MEM_DEFINED(SlabChunkGetPointer(chunk),sizeof(int32));
728729
idx=*(int32*)SlabChunkGetPointer(chunk);
729730
}
730731

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp