Skip to content

some minor memory allocation cleanups

Jeff King git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3normalize_path_copy(): document "dst" size expectationspath.c+2 -02 replies
2/3walker_fetch(): avoid raw array length computationwalker.c+3 -10 replies
3/3traverse_trees(): use stack array for name entriestree-walk.c+8 -55 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] some minor memory allocation cleanups

These are a result of me poking at the results of:

git grep 'x[mc]alloc.*[+*] '

looking for any buffer allocation computations that could overflow (and hence under-allocate).

There are a few hits left after this in the commit-graph code. Those will be dealt with in a separate series (coming soon!) since they have other problems, as discussed in:

https://lore.kernel.org/git/[email protected]/

(those have to do with normalize_path_copy(), hence the only semi-related documentation patch here).

[1/3]: normalize_path_copy(): document "dst" size expectations [2/3]: walker_fetch(): avoid raw array length computation [3/3]: traverse_trees(): use stack array for name entries

 path.c      |  2 ++
 tree-walk.c | 13 ++++++++-----
 walker.c    |  4 +++-
 3 files changed, 13 insertions(+), 6 deletions(-)

-Peff