Reduce memory leakage in initdb.
Tom Lane <tgl@sss.pgh.pa.us>
Reduce memory leakage in initdb. While testing commit 3e51b278d, I noted that initdb leaks about a megabyte worth of data due to the sloppy bookkeeping in its string-manipulating code. That's not a huge amount on modern machines, but it's still kind of annoying, and it's easy to fix by recognizing that we might as well treat these arrays of strings as modifiable-in-place. There's no caller that cares about preserving the old state of the array after replace_token or replace_guc_value. With this fix, valgrind sees only a few hundred bytes leaked during an initdb run. Discussion: https://postgr.es/m/2844176.1674681919@sss.pgh.pa.us
Files
| Path | Change | +/− |
|---|---|---|
| src/bin/initdb/initdb.c | modified | +34 −53 |
Discussion
- Set arbitrary GUC options during initdb 19 messages · 2023-01-25 → 2023-04-14