You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-06-27 00:21:08 +02:00
Add OBJECT_DEFINE_MOVE() macro.
The object *Move() functions are very repetitive so replace them with a macro that works similarly to OBJECT_DEFINE_FREE().
This commit is contained in:
@ -28,6 +28,7 @@ struct PgClient
|
||||
PGconn *connection;
|
||||
};
|
||||
|
||||
OBJECT_DEFINE_MOVE(PG_CLIENT);
|
||||
OBJECT_DEFINE_FREE(PG_CLIENT);
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
@ -358,25 +359,6 @@ pgClientClose(PgClient *this)
|
||||
FUNCTION_LOG_RETURN_VOID();
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Move the pg client object to a new context
|
||||
***********************************************************************************************************************************/
|
||||
PgClient *
|
||||
pgClientMove(PgClient *this, MemContext *parentNew)
|
||||
{
|
||||
FUNCTION_TEST_BEGIN();
|
||||
FUNCTION_TEST_PARAM(PG_CLIENT, this);
|
||||
FUNCTION_TEST_PARAM(MEM_CONTEXT, parentNew);
|
||||
FUNCTION_TEST_END();
|
||||
|
||||
ASSERT(parentNew != NULL);
|
||||
|
||||
if (this != NULL)
|
||||
memContextMove(this->memContext, parentNew);
|
||||
|
||||
FUNCTION_TEST_RETURN(this);
|
||||
}
|
||||
|
||||
/***********************************************************************************************************************************
|
||||
Render as string for logging
|
||||
***********************************************************************************************************************************/
|
||||
|
Reference in New Issue
Block a user