aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2017-03-08 16:19:37 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2017-03-08 16:19:37 -0500
commit2f899e7d37ece937740c99164dd846c4b6f884eb (patch)
treeebebbc24205311f413d6239c1365ebabc89a2adf
parentf379121093deb5465b01d93ebe9410d96c6cd093 (diff)
downloadpostgresql-2f899e7d37ece937740c99164dd846c4b6f884eb.tar.gz
postgresql-2f899e7d37ece937740c99164dd846c4b6f884eb.zip
Suppress compiler warning in slab.c.
Compilers that don't realize that elog(ERROR) doesn't return complained that SlabRealloc() failed to return a value. While at it, fix the rather muddled header comment for the function. Per buildfarm.
-rw-r--r--src/backend/utils/mmgr/slab.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/backend/utils/mmgr/slab.c b/src/backend/utils/mmgr/slab.c
index 11a126acf36..d6be4fe6603 100644
--- a/src/backend/utils/mmgr/slab.c
+++ b/src/backend/utils/mmgr/slab.c
@@ -547,14 +547,14 @@ SlabFree(MemoryContext context, void *pointer)
/*
* SlabRealloc
- * As Slab is designed for allocating equally-sized chunks of memory, it
- * can't really do an actual realloc.
+ * Change the allocated size of a chunk.
*
- * We try to be gentle and allow calls with exactly the same size as in that
- * case we can simply return the same chunk. When the size differs, we fail
- * with assert failure or return NULL.
+ * As Slab is designed for allocating equally-sized chunks of memory, it can't
+ * do an actual chunk size change. We try to be gentle and allow calls with
+ * exactly the same size, as in that case we can simply return the same
+ * chunk. When the size differs, we throw an error.
*
- * We might be even support cases with (size < chunkSize). That however seems
+ * We could also allow requests with size < chunkSize. That however seems
* rather pointless - Slab is meant for chunks of constant size, and moreover
* realloc is usually used to enlarge the chunk.
*/
@@ -570,6 +570,7 @@ SlabRealloc(MemoryContext context, void *pointer, Size size)
return pointer;
elog(ERROR, "slab allocator does not support realloc()");
+ return NULL; /* keep compiler quiet */
}
/*