1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2024-12-16 10:20:02 +02:00
pgbackrest/test
David Steele c7a66ac1af
Improve memory usage of mem contexts.
Each mem context can track child contexts, allocations, and a callback. Before this change memory was allocated for tracking all three even if they were not used for a particular context. This made mem contexts unsuitable for String and Variant objects since they are plentiful and need to be as small as possible.

This change allows mem contexts to be configured to track any combination of child contexts, allocations, and a callback. In addition, the mem context can be configured to track a single child context and/or allocation, which saves memory and is a common use case.

Another benefit is that Variants can own objects (e.g. KeyValue) that they encapsulate. All of this makes memory accounting simpler because mem contexts have names while allocations do not. No more memory is used than before since Variants and Strings still had to store the memory context they were originally allocated in so they could be easily freed.

Update the String and Variant objects to use this new functionality. The custom strFree() and varFree() functions are no longer required and can now be a wrapper around objFree().

Lastly, this will allow strMove() and varMove() to be implemented and used in cases where strDup() and varDup() are being used to move a String or Variant to a new context. Since this will be a bit noisy it is saved for a future commit.
2022-05-18 10:52:01 -04:00
..
certificate Add TLS Server. 2021-10-18 14:32:41 -04:00
code-count v2.39: Verify and File Bundling 2022-05-16 08:46:24 -04:00
data Automate generation of WAL and pg_control test files. 2017-11-18 20:02:54 -05:00
lib/pgBackRestTest Move 32-bit CI testing from Debian 9 to Ubuntu 18.04. 2022-05-12 11:57:12 -04:00
src Improve memory usage of mem contexts. 2022-05-18 10:52:01 -04:00
.gitignore Move coverage results to test/result. 2020-03-14 15:29:42 -04:00
ci.pl Use Rocky Linux for documentation builds instead of CentOS. 2021-10-28 15:15:49 -04:00
container.yaml Move 32-bit CI testing from Debian 9 to Ubuntu 18.04. 2022-05-12 11:57:12 -04:00
define.yaml Add zNewFmt(). 2022-05-06 12:32:49 -04:00
Dockerfile Use vagrant user in the Docker container. 2022-02-26 13:50:30 -06:00
test.pl Remove integration expect log testing. 2022-05-10 13:18:26 -04:00
Vagrantfile Update Vagrantfile to Ubuntu 20.04. 2021-10-13 13:21:04 -04:00