Skip to content

Commit

Permalink
Add const to memContextFreeing()/memContextName() parameters.
Browse files Browse the repository at this point in the history
These functions do not modify the mem context so they can use const pointers.
  • Loading branch information
dwsteele committed Aug 23, 2021
1 parent 726d04f commit beafdbf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/common/memContext.c
Expand Up @@ -673,7 +673,7 @@ memContextCurrent(void)

/**********************************************************************************************************************************/
bool
memContextFreeing(MemContext *this)
memContextFreeing(const MemContext *const this)
{
FUNCTION_TEST_BEGIN();
FUNCTION_TEST_PARAM(MEM_CONTEXT, this);
Expand All @@ -686,7 +686,7 @@ memContextFreeing(MemContext *this)

/**********************************************************************************************************************************/
const char *
memContextName(MemContext *this)
memContextName(const MemContext *const this)
{
FUNCTION_TEST_BEGIN();
FUNCTION_TEST_PARAM(MEM_CONTEXT, this);
Expand Down
4 changes: 2 additions & 2 deletions src/common/memContext.h
Expand Up @@ -241,7 +241,7 @@ Memory context getters
MemContext *memContextCurrent(void);

// Is the mem context currently being freed?
bool memContextFreeing(MemContext *this);
bool memContextFreeing(const MemContext *this);

// Prior context, i.e. the context that was current before the last memContextSwitch()
MemContext *memContextPrior(void);
Expand All @@ -251,7 +251,7 @@ MemContext *memContextPrior(void);
MemContext *memContextTop(void);

// Mem context name
const char *memContextName(MemContext *this);
const char *memContextName(const MemContext *this);

// Get total size of mem context and all children
size_t memContextSize(const MemContext *this);
Expand Down

0 comments on commit beafdbf

Please sign in to comment.