diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-02-26 13:37:16 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-02-26 13:37:16 -0800 |
commit | 11529ecec914d2f0d7575e6d443c2d5a6ff75424 (patch) | |
tree | f91bf9915ab0499913b8ee0e941a642183b7da67 /Documentation/technical | |
parent | Merge branch 'jk/more-comments-on-textconv' (diff) | |
parent | ewah: convert to REALLOC_ARRAY, etc (diff) | |
download | tgif-11529ecec914d2f0d7575e6d443c2d5a6ff75424.tar.xz |
Merge branch 'jk/tighten-alloc'
Update various codepaths to avoid manually-counted malloc().
* jk/tighten-alloc: (22 commits)
ewah: convert to REALLOC_ARRAY, etc
convert ewah/bitmap code to use xmalloc
diff_populate_gitlink: use a strbuf
transport_anonymize_url: use xstrfmt
git-compat-util: drop mempcpy compat code
sequencer: simplify memory allocation of get_message
test-path-utils: fix normalize_path_copy output buffer size
fetch-pack: simplify add_sought_entry
fast-import: simplify allocation in start_packfile
write_untracked_extension: use FLEX_ALLOC helper
prepare_{git,shell}_cmd: use argv_array
use st_add and st_mult for allocation size computation
convert trivial cases to FLEX_ARRAY macros
use xmallocz to avoid size arithmetic
convert trivial cases to ALLOC_ARRAY
convert manual allocations to argv_array
argv-array: add detach function
add helpers for allocating flex-array structs
harden REALLOC_ARRAY and xcalloc against size_t overflow
tree-diff: catch integer overflow in combine_diff_path allocation
...
Diffstat (limited to 'Documentation/technical')
-rw-r--r-- | Documentation/technical/api-argv-array.txt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Documentation/technical/api-argv-array.txt b/Documentation/technical/api-argv-array.txt index 8076172a08..cfc063018c 100644 --- a/Documentation/technical/api-argv-array.txt +++ b/Documentation/technical/api-argv-array.txt @@ -56,3 +56,10 @@ Functions `argv_array_clear`:: Free all memory associated with the array and return it to the initial, empty state. + +`argv_array_detach`:: + Disconnect the `argv` member from the `argv_array` struct and + return it. The caller is responsible for freeing the memory used + by the array, and by the strings it references. After detaching, + the `argv_array` is in a reinitialized state and can be pushed + into again. |