git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e800bd7)
Change MemoryContextMemAllocated to return Size
Sat, 5 Oct 2019 18:49:39 +0000 (20:49 +0200)
Sat, 5 Oct 2019 18:49:39 +0000 (20:49 +0200)
Commit f2369bc610 switched most of the memory accounting from int64 to
Size, but it forgot to change the MemoryContextMemAllocated return type.
So this fixes that omission.

Discussion: https://www.postgresql.org/message-id/11238.1570200198%40sss.pgh.pa.us


diff --git a/src/backend/utils/mmgr/mcxt.c b/src/backend/utils/mmgr/mcxt.c
index 7bbfabe0eab7c338942ae999633f621b710a9b90..d52bd2c073ce0af6d30463f438d6a56d670ba869 100644 (file)
--- a/src/backend/utils/mmgr/mcxt.c
+++ b/src/backend/utils/mmgr/mcxt.c
@@ -466,10 +466,10 @@ MemoryContextIsEmpty(MemoryContext context)
* Find the memory allocated to blocks for this memory context. If recurse is
* true, also include children.
*/
-int64
+Size
MemoryContextMemAllocated(MemoryContext context, bool recurse)
{
- int64 total = context->mem_allocated;
+ Size total = context->mem_allocated;
AssertArg(MemoryContextIsValid(context));
diff --git a/src/include/utils/memutils.h b/src/include/utils/memutils.h
index 6a837bc99020fbb2c9e231099ece6f95f9fe8954..106c83da45fe176ef66e099b90b2896336a063d1 100644 (file)
--- a/src/include/utils/memutils.h
+++ b/src/include/utils/memutils.h
@@ -82,7 +82,7 @@ extern void MemoryContextSetParent(MemoryContext context,
extern Size GetMemoryChunkSpace(void *pointer);
extern MemoryContext MemoryContextGetParent(MemoryContext context);
extern bool MemoryContextIsEmpty(MemoryContext context);
-extern int64 MemoryContextMemAllocated(MemoryContext context, bool recurse);
+extern Size MemoryContextMemAllocated(MemoryContext context, bool recurse);
extern void MemoryContextStats(MemoryContext context);
extern void MemoryContextStatsDetail(MemoryContext context, int max_children);
extern void MemoryContextAllowInCriticalSection(MemoryContext context,
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /