pgbackrest.git / summary / log / commit / refs

commit    729d7f071dafe22f85201bfaf2bae461ec54d285
Author:   David Steele <david@pgmasters.net>
Date:     Fri Dec 30 11:45:11 2022 +0000

    Put memContextSize() in a DEBUG block.
    
    This function is only used in unit tests so no need to include it in the release build.


src/common/memContext.c | 4 ++++ src/common/memContext.h | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/common/memContext.c b/src/common/memContext.c index 68a04b399..cbe64b392 100644 --- a/src/common/memContext.c +++ b/src/common/memContext.c @@ -950,6 +950,8 @@ memContextPrior(void) } /**********************************************************************************************************************************/ +#ifdef DEBUG + size_t memContextSize(const MemContext *const this) { @@ -1033,6 +1035,8 @@ memContextSize(const MemContext *const this) FUNCTION_TEST_RETURN(SIZE, (size_t)(offset - (unsigned char *)this) + total); } +#endif // DEBUG + /**********************************************************************************************************************************/ void memContextClean(const unsigned int tryDepth, const bool fatal) diff --git a/src/common/memContext.h b/src/common/memContext.h index c1316c235..8c320ef6d 100644 --- a/src/common/memContext.h +++ b/src/common/memContext.h @@ -284,7 +284,9 @@ MemContext *memContextPrior(void); MemContext *memContextTop(void); // Get total size of mem context and all children -size_t memContextSize(const MemContext *this); +#ifdef DEBUG + size_t memContextSize(const MemContext *this); +#endif // DEBUG /*********************************************************************************************************************************** Macros for function logging [parent: cebbf0d012ad]