1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-07-15 01:04:37 +02:00

Add macros for object free functions.

Most of the *Free() functions are pretty generic so add macros to make creating them as easy as possible.

Create a distinction between *Free() functions that the caller uses to free memory and callbacks that free third-party resources.  There are a number of cases where a driver needs to free resources but does not need a normal *Free() because it is handled by the interface.

Add common/object.h for macros that make object maintenance easier.  This pattern can also be used for many more object functions.
This commit is contained in:
David Steele
2019-05-03 18:52:54 -04:00
parent 7ae96949f1
commit f1eea23121
95 changed files with 684 additions and 910 deletions

View File

@ -265,7 +265,6 @@ testRun(void)
TEST_RESULT_BOOL(testIoReadCloseCalled, true, " check io object closed");
TEST_RESULT_VOID(ioReadFree(read), " free read object");
TEST_RESULT_VOID(ioReadFree(NULL), " free null read object");
// Read a zero-length buffer to be sure it is not passed on to the filter group
// -------------------------------------------------------------------------------------------------------------------------
@ -333,10 +332,7 @@ testRun(void)
TEST_RESULT_PTR(ioFilterInterface(bufferFilter), &bufferFilter->interface, " check filter interface");
TEST_RESULT_VOID(ioFilterFree(bufferFilter), " free buffer filter");
TEST_RESULT_VOID(ioFilterFree(NULL), " free NULL filter");
TEST_RESULT_VOID(ioFilterGroupFree(filterGroup), " free filter group object");
TEST_RESULT_VOID(ioFilterGroupFree(NULL), " free NULL filter group object");
// Mixed line and buffer read
// -------------------------------------------------------------------------------------------------------------------------
@ -415,7 +411,6 @@ testRun(void)
TEST_RESULT_BOOL(testIoWriteCloseCalled, true, " check io object closed");
TEST_RESULT_VOID(ioWriteFree(write), " free write object");
TEST_RESULT_VOID(ioWriteFree(NULL), " free null write object");
// -------------------------------------------------------------------------------------------------------------------------
ioBufferSizeSet(3);