You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-07-05 00:28:52 +02:00
Add MEM_CONTEXT_PRIOR() block and update current call sites.
This macro block encapsulates the common pattern of switching to the prior (formerly called old) mem context to return results from a function. Also rename MEM_CONTEXT_OLD() to memContextPrior(). This violates our convention of macros being in all caps but memContextPrior() will become a function very soon so this will reduce churn.
This commit is contained in:
@ -83,8 +83,8 @@ testRun(void)
|
||||
MEM_CONTEXT_TEMP_BEGIN()
|
||||
{
|
||||
TEST_ASSIGN(testObject, testObjectNew(), "new test object");
|
||||
TEST_RESULT_VOID(testObjectMove(testObject, MEM_CONTEXT_OLD()), "move object to parent context");
|
||||
TEST_RESULT_VOID(testObjectMove(NULL, MEM_CONTEXT_OLD()), "move null object");
|
||||
TEST_RESULT_VOID(testObjectMove(testObject, memContextPrior()), "move object to parent context");
|
||||
TEST_RESULT_VOID(testObjectMove(NULL, memContextPrior()), "move null object");
|
||||
}
|
||||
MEM_CONTEXT_TEMP_END();
|
||||
|
||||
|
Reference in New Issue
Block a user