提交 f7748ed5 编写于 作者: A Ashwin Agrawal

Fix compiler warnings for ext_alloc.c.

After commit 1822c826 started seeing bunch of
warnings like
-------------------------------------------
memaccounting.c:247:1: warning: no previous prototype for function 'MemoryAccounting_DeclareDone' [-Wmissing-prototypes]
MemoryAccounting_DeclareDone()
^
../../../../src/include/utils/memaccounting.h:238:1: note: this declaration is not a prototype; add 'void' to make it a prototype for a zero-parameter function
MemoryAccounting_DeclareDone();
^
                             void
memaccounting.c:263:1: warning: no previous prototype for function 'MemoryAccounting_RequestQuotaIncrease' [-Wmissing-prototypes]
MemoryAccounting_RequestQuotaIncrease()
^
../../../../src/include/utils/memaccounting.h:241:1: note: this declaration is not a prototype; add 'void' to make it a prototype for a zero-parameter function
MemoryAccounting_RequestQuotaIncrease();
^
                                      void
2 warnings generated.
ext_alloc.c:35:1: warning: no previous prototype for function 'Ext_OptimizerAlloc' [-Wmissing-prototypes]
Ext_OptimizerAlloc(size_t size)
^
ext_alloc.c:50:17: warning: unused variable 'account' [-Wunused-variable]
        MemoryAccount *account = MemoryAccounting_ConvertIdToAccount(ActiveMemoryAccountId);
                       ^
ext_alloc.c:48:1: warning: no previous prototype for function 'Ext_OptimizerFree' [-Wmissing-prototypes]
Ext_OptimizerFree(void *ptr)
^
ext_alloc.c:59:1: warning: no previous prototype for function 'GetOptimizerOutstandingMemoryBalance' [-Wmissing-prototypes]
GetOptimizerOutstandingMemoryBalance()
^
-------------------------------------------
上级 49970964
......@@ -15,6 +15,7 @@
#include "utils/gp_alloc.h"
#include "utils/memaccounting.h"
#include "utils/memaccounting_private.h"
#include "utils/ext_alloc.h"
/*
* This variable is used to track memory that is not freed by Orca during a
......@@ -47,7 +48,6 @@ Ext_OptimizerAlloc(size_t size)
void
Ext_OptimizerFree(void *ptr)
{
MemoryAccount *account = MemoryAccounting_ConvertIdToAccount(ActiveMemoryAccountId);
void *malloc_pointer = UserPtr_GetVmemPtr(ptr);
size_t freed_size = VmemPtr_GetUserPtrSize((VmemHeader*) malloc_pointer);
MemoryAccounting_Free(ActiveMemoryAccountId, freed_size);
......
......@@ -24,7 +24,7 @@ extern void*
Ext_OptimizerAlloc(size_t size);
extern uint64
GetOptimizerOutstandingMemoryBalance();
GetOptimizerOutstandingMemoryBalance(void);
#ifdef __cplusplus
......
......@@ -235,10 +235,10 @@ extern void
MemoryAccounting_PrettyPrint(void);
extern uint64
MemoryAccounting_DeclareDone();
MemoryAccounting_DeclareDone(void);
extern uint64
MemoryAccounting_RequestQuotaIncrease();
MemoryAccounting_RequestQuotaIncrease(void);
extern void
MemoryAccounting_ExplainAppendCurrentOptimizerAccountInfo(StringInfoData *str);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册