Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 36425ec

Browse files
committed
Change MemoryContextMemAllocated to return Size
Commit f2369bc 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
1 parent e800bd7 commit 36425ec

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/backend/utils/mmgr/mcxt.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -466,10 +466,10 @@ MemoryContextIsEmpty(MemoryContext context)
466466
* Find the memory allocated to blocks for this memory context. If recurse is
467467
* true, also include children.
468468
*/
469-
int64
469+
Size
470470
MemoryContextMemAllocated(MemoryContext context, bool recurse)
471471
{
472-
int64 total = context->mem_allocated;
472+
Size total = context->mem_allocated;
473473

474474
AssertArg(MemoryContextIsValid(context));
475475

src/include/utils/memutils.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ extern void MemoryContextSetParent(MemoryContext context,
8282
extern Size GetMemoryChunkSpace(void *pointer);
8383
extern MemoryContext MemoryContextGetParent(MemoryContext context);
8484
extern bool MemoryContextIsEmpty(MemoryContext context);
85-
extern int64 MemoryContextMemAllocated(MemoryContext context, bool recurse);
85+
extern Size MemoryContextMemAllocated(MemoryContext context, bool recurse);
8686
extern void MemoryContextStats(MemoryContext context);
8787
extern void MemoryContextStatsDetail(MemoryContext context, int max_children);
8888
extern void MemoryContextAllowInCriticalSection(MemoryContext context,

0 commit comments

Comments
 (0)