diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-12-04 10:14:38 +0900 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-12-04 10:14:40 +0900 |
| commit | a5dd262a7504fc816d0aad7c7dc7eb73cb0adf82 (patch) | |
| tree | cac04682f84642083987a06d1c2ae6ebcf8e4a38 /strvec.h | |
| parent | Merge branch 'ps/gc-stale-lock-warning' (diff) | |
| parent | t: remove TEST_PASSES_SANITIZE_LEAK annotations (diff) | |
| download | git-a5dd262a7504fc816d0aad7c7dc7eb73cb0adf82.tar.gz git-a5dd262a7504fc816d0aad7c7dc7eb73cb0adf82.zip | |
Merge branch 'ps/leakfixes-part-10'
Leakfixes.
* ps/leakfixes-part-10: (27 commits)
t: remove TEST_PASSES_SANITIZE_LEAK annotations
test-lib: unconditionally enable leak checking
t: remove unneeded !SANITIZE_LEAK prerequisites
t: mark some tests as leak free
t5601: work around leak sanitizer issue
git-compat-util: drop now-unused `UNLEAK()` macro
global: drop `UNLEAK()` annotation
t/helper: fix leaking commit graph in "read-graph" subcommand
builtin/branch: fix leaking sorting options
builtin/init-db: fix leaking directory paths
builtin/help: fix leaks in `check_git_cmd()`
help: fix leaking return value from `help_unknown_cmd()`
help: fix leaking `struct cmdnames`
help: refactor to not use globals for reading config
builtin/sparse-checkout: fix leaking sanitized patterns
split-index: fix memory leak in `move_cache_to_base_index()`
git: refactor builtin handling to use a `struct strvec`
git: refactor alias handling to use a `struct strvec`
strvec: introduce new `strvec_splice()` function
line-log: fix leak when rewriting commit parents
...
Diffstat (limited to 'strvec.h')
| -rw-r--r-- | strvec.h | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -67,6 +67,15 @@ void strvec_pushl(struct strvec *, ...); /* Push a null-terminated array of strings onto the end of the array. */ void strvec_pushv(struct strvec *, const char **); +/* + * Replace `len` values starting at `idx` with the provided replacement + * strings. If `len` is zero this is effectively an insert at the given `idx`. + * If `replacement_len` is zero this is effectively a delete of `len` items + * starting at `idx`. + */ +void strvec_splice(struct strvec *array, size_t idx, size_t len, + const char **replacement, size_t replacement_len); + /** * Replace the value at the given index with a new value. The index must be * valid. Returns a pointer to the inserted value. |
