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

Commit2f899e7

Browse files
committed
Suppress compiler warning in slab.c.
Compilers that don't realize that elog(ERROR) doesn't returncomplained that SlabRealloc() failed to return a value.While at it, fix the rather muddled header comment for the function.Per buildfarm.
1 parentf379121 commit2f899e7

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

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

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -547,14 +547,14 @@ SlabFree(MemoryContext context, void *pointer)
547547

548548
/*
549549
* SlabRealloc
550-
*As Slab is designed for allocating equally-sized chunks of memory, it
551-
*can't really do an actual realloc.
550+
*Change the allocated size of a chunk.
552551
*
553-
* We try to be gentle and allow calls with exactly the same size as in that
554-
* case we can simply return the same chunk. When the size differs, we fail
555-
* with assert failure or return NULL.
552+
* As Slab is designed for allocating equally-sized chunks of memory, it can't
553+
* do an actual chunk size change. We try to be gentle and allow calls with
554+
* exactly the same size, as in that case we can simply return the same
555+
* chunk. When the size differs, we throw an error.
556556
*
557-
* Wemight be even support caseswith(size < chunkSize). That however seems
557+
* Wecould also allow requestswith size < chunkSize. That however seems
558558
* rather pointless - Slab is meant for chunks of constant size, and moreover
559559
* realloc is usually used to enlarge the chunk.
560560
*/
@@ -570,6 +570,7 @@ SlabRealloc(MemoryContext context, void *pointer, Size size)
570570
returnpointer;
571571

572572
elog(ERROR,"slab allocator does not support realloc()");
573+
returnNULL;/* keep compiler quiet */
573574
}
574575

575576
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp