You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-07-07 00:35:37 +02:00
More efficient memory allocation for Strings and String Variants.
The vast majority of Strings are never modified so for most cases allocate memory for the string with the object. This results in one allocation in most cases instead of two. Use strNew() if strCat*() functions are needed. Update varNewStr() in the same way since String Variants can never be modified. This results in one allocation in all cases instead of three. Also update varNewStrZ() to use STR() instead of strNewZ() to save two more allocations.
This commit is contained in:
@ -876,7 +876,7 @@ testRun(void)
|
||||
TEST_TITLE("encrypted/compressed file in backup");
|
||||
|
||||
// Create a compressed encrypted repo file in backup
|
||||
filePathName = strNewZ(STORAGE_REPO_BACKUP "/testfile");
|
||||
filePathName = strCatZ(strNew(), STORAGE_REPO_BACKUP "/testfile");
|
||||
HRN_STORAGE_PUT_Z(
|
||||
storageRepoWrite(), strZ(filePathName), fileContents, .compressType = compressTypeGz, .cipherType = cipherTypeAes256Cbc,
|
||||
.cipherPass = "pass");
|
||||
|
Reference in New Issue
Block a user