]> git.ipfire.org Git - thirdparty/git.git/commitdiff
git-compat-util: move alloc macros to git-compat-util.h
authorCalvin Wan <calvinwan@google.com>
Wed, 5 Jul 2023 17:09:24 +0000 (17:09 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 5 Jul 2023 18:42:31 +0000 (11:42 -0700)
alloc_nr, ALLOC_GROW, and ALLOC_GROW_BY are commonly used macros for
dynamic array allocation. Moving these macros to git-compat-util.h with
the other alloc macros focuses alloc.[ch] to allocation for Git objects
and additionally allows us to remove inclusions to alloc.h from files
that solely used the above macros.

Signed-off-by: Calvin Wan <calvinwan@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
88 files changed:
add-patch.c
alias.c
alloc.h
apply.c
archive-tar.c
archive.c
attr.c
builtin/blame.c
builtin/cat-file.c
builtin/checkout--worker.c
builtin/config.c
builtin/credential-cache--daemon.c
builtin/fetch-pack.c
builtin/fsmonitor--daemon.c
builtin/grep.c
builtin/index-pack.c
builtin/log.c
builtin/merge.c
builtin/mktree.c
builtin/mv.c
builtin/name-rev.c
builtin/pack-objects.c
builtin/repack.c
builtin/rev-parse.c
builtin/revert.c
builtin/rm.c
builtin/submodule--helper.c
bulk-checkin.c
cache-tree.c
chunk-format.c
commit-reach.c
config.c
daemon.c
delta-islands.c
diff.c
diffcore-rename.c
dir-iterator.c
dir.c
ewah/bitmap.c
ewah/ewah_bitmap.c
fetch-pack.c
fmt-merge-msg.c
fsck.c
git-compat-util.h
help.c
http-backend.c
line-log.c
list-objects-filter-options.c
list-objects-filter.c
midx.c
object-file.c
oid-array.c
oidtree.c
pack-bitmap-write.c
pack-bitmap.c
pack-objects.c
packfile.c
parallel-checkout.c
pretty.c
prio-queue.c
quote.c
read-cache.c
ref-filter.c
reflog-walk.c
refs.c
refspec.c
remote-curl.c
remote.c
rerere.c
revision.c
sequencer.c
server-info.c
shallow.c
sigchain.c
sparse-index.c
split-index.c
strbuf.c
string-list.c
strvec.c
submodule-config.c
submodule.c
t/helper/test-reach.c
trace2/tr2_tls.c
trailer.c
transport.c
tree-walk.c
userdiff.c
worktree.c

index 53e324829593bd3444919b1666deefe354ca8bcb..f12cbe4166b53a25c4e984b8afb182adcb034ab8 100644 (file)
@@ -1,7 +1,6 @@
 #include "git-compat-util.h"
 #include "add-interactive.h"
 #include "advice.h"
-#include "alloc.h"
 #include "editor.h"
 #include "environment.h"
 #include "gettext.h"
diff --git a/alias.c b/alias.c
index 54a1a23d2cf1a5983e47f4369fe08ef935616508..38e13399367adf169e73c81cd727efe3164bd5d3 100644 (file)
--- a/alias.c
+++ b/alias.c
@@ -1,6 +1,5 @@
 #include "git-compat-util.h"
 #include "alias.h"
-#include "alloc.h"
 #include "config.h"
 #include "gettext.h"
 #include "strbuf.h"
diff --git a/alloc.h b/alloc.h
index 4312db4bd087bde3632c547bb72d0b5cc77be713..3f4a0ad310a94bd026f48f48491985e3e2053ee2 100644 (file)
--- a/alloc.h
+++ b/alloc.h
@@ -17,79 +17,4 @@ void *alloc_object_node(struct repository *r);
 struct alloc_state *allocate_alloc_state(void);
 void clear_alloc_state(struct alloc_state *s);
 
-#define alloc_nr(x) (((x)+16)*3/2)
-
-/**
- * Dynamically growing an array using realloc() is error prone and boring.
- *
- * Define your array with:
- *
- * - a pointer (`item`) that points at the array, initialized to `NULL`
- *   (although please name the variable based on its contents, not on its
- *   type);
- *
- * - an integer variable (`alloc`) that keeps track of how big the current
- *   allocation is, initialized to `0`;
- *
- * - another integer variable (`nr`) to keep track of how many elements the
- *   array currently has, initialized to `0`.
- *
- * Then before adding `n`th element to the item, call `ALLOC_GROW(item, n,
- * alloc)`.  This ensures that the array can hold at least `n` elements by
- * calling `realloc(3)` and adjusting `alloc` variable.
- *
- * ------------
- * sometype *item;
- * size_t nr;
- * size_t alloc
- *
- * for (i = 0; i < nr; i++)
- *     if (we like item[i] already)
- *             return;
- *
- * // we did not like any existing one, so add one
- * ALLOC_GROW(item, nr + 1, alloc);
- * item[nr++] = value you like;
- * ------------
- *
- * You are responsible for updating the `nr` variable.
- *
- * If you need to specify the number of elements to allocate explicitly
- * then use the macro `REALLOC_ARRAY(item, alloc)` instead of `ALLOC_GROW`.
- *
- * Consider using ALLOC_GROW_BY instead of ALLOC_GROW as it has some
- * added niceties.
- *
- * DO NOT USE any expression with side-effect for 'x', 'nr', or 'alloc'.
- */
-#define ALLOC_GROW(x, nr, alloc) \
-       do { \
-               if ((nr) > alloc) { \
-                       if (alloc_nr(alloc) < (nr)) \
-                               alloc = (nr); \
-                       else \
-                               alloc = alloc_nr(alloc); \
-                       REALLOC_ARRAY(x, alloc); \
-               } \
-       } while (0)
-
-/*
- * Similar to ALLOC_GROW but handles updating of the nr value and
- * zeroing the bytes of the newly-grown array elements.
- *
- * DO NOT USE any expression with side-effect for any of the
- * arguments.
- */
-#define ALLOC_GROW_BY(x, nr, increase, alloc) \
-       do { \
-               if (increase) { \
-                       size_t new_nr = nr + (increase); \
-                       if (new_nr < nr) \
-                               BUG("negative growth in ALLOC_GROW_BY"); \
-                       ALLOC_GROW(x, new_nr, alloc); \
-                       memset((x) + nr, 0, sizeof(*(x)) * (increase)); \
-                       nr = new_nr; \
-               } \
-       } while (0)
-
 #endif
diff --git a/apply.c b/apply.c
index 99c2a91de7a326d6f5c0ecff3dc4857fee75a756..6b9ce54f7d22708fdaf71e93be957889a12e56c0 100644 (file)
--- a/apply.c
+++ b/apply.c
@@ -9,7 +9,6 @@
 
 #include "git-compat-util.h"
 #include "abspath.h"
-#include "alloc.h"
 #include "base85.h"
 #include "config.h"
 #include "object-store-ll.h"
index fc06ff4c5d69b3580ffffaac769186c52878902e..704bf0612e752b3dc34f14e07f6703fcc3a8d727 100644 (file)
@@ -2,7 +2,6 @@
  * Copyright (c) 2005, 2006 Rene Scharfe
  */
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "config.h"
 #include "gettext.h"
 #include "git-zlib.h"
index 1817cca9f4ccec4d7dc45c3d539f11170862bb25..ca11db185b15a73dd31b239d91a609071faa9a2a 100644 (file)
--- a/archive.c
+++ b/archive.c
@@ -1,6 +1,5 @@
 #include "git-compat-util.h"
 #include "abspath.h"
-#include "alloc.h"
 #include "config.h"
 #include "convert.h"
 #include "environment.h"
diff --git a/attr.c b/attr.c
index 7d39ac4a29bc628e173b85e4b235e70cf01841cc..e9c81b6e079db01557450edd3dc2228ed3564388 100644 (file)
--- a/attr.c
+++ b/attr.c
@@ -7,7 +7,6 @@
  */
 
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "config.h"
 #include "environment.h"
 #include "exec-cmd.h"
index e811e7fbfb1e0425b334aa0f91ac7527b0d316a1..9a3f9facea00e49419353f8e6ad92441160b900e 100644 (file)
@@ -6,7 +6,6 @@
  */
 
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "config.h"
 #include "color.h"
 #include "builtin.h"
index ab8ac105e3a0c8646c3735acdf316fac1830393f..84d2e1de1e44c514169a96fac498208e6de1ee95 100644 (file)
@@ -5,7 +5,6 @@
  */
 #define USE_THE_INDEX_VARIABLE
 #include "builtin.h"
-#include "alloc.h"
 #include "config.h"
 #include "convert.h"
 #include "diff.h"
index c655dc4b1369eaae83c2c997f0b1f2d303c225dd..6b62b5375bd2bf0d998f74ba2c63c071a5e76e73 100644 (file)
@@ -1,5 +1,4 @@
 #include "builtin.h"
-#include "alloc.h"
 #include "config.h"
 #include "entry.h"
 #include "gettext.h"
index e944b6bb7a474b5a937fe74230fc710de8dc70bd..7e92ce66bfa352142ac89611e80242e6e33ad81d 100644 (file)
@@ -1,6 +1,5 @@
 #include "builtin.h"
 #include "abspath.h"
-#include "alloc.h"
 #include "config.h"
 #include "color.h"
 #include "editor.h"
index dc1cf2d25fc04c6f08c54f14589704f426bdd3d7..3a6a750a8eb320bb3622184843ede3d2b9884385 100644 (file)
@@ -1,6 +1,5 @@
 #include "builtin.h"
 #include "abspath.h"
-#include "alloc.h"
 #include "gettext.h"
 #include "object-file.h"
 #include "parse-options.h"
index 3ba0fe5a39614b3785f80ad75cd0f3a494547f37..44c05ee86cc7048e72e455f4c2a28a1d42a1f7fa 100644 (file)
@@ -1,5 +1,4 @@
 #include "builtin.h"
-#include "alloc.h"
 #include "gettext.h"
 #include "hex.h"
 #include "object-file.h"
index 74d1d6a585d8189c1421f8528f749b139d9aa125..0194f1e263fce6276796d0d74842a0dfe6005a0a 100644 (file)
@@ -1,6 +1,5 @@
 #include "builtin.h"
 #include "abspath.h"
-#include "alloc.h"
 #include "config.h"
 #include "environment.h"
 #include "gettext.h"
index 72e70b3a48dc6b30f2c71018aac274cf30f7574f..c60cf2007f345df81d59228833110a5f8fa35bdf 100644 (file)
@@ -4,7 +4,6 @@
  * Copyright (c) 2006 Junio C Hamano
  */
 #include "builtin.h"
-#include "alloc.h"
 #include "gettext.h"
 #include "hex.h"
 #include "repository.h"
index f8e13088051f5d0c37f1109cdedc9f35543f3d56..356410a9d4bfaafaa35c019a7795c52b5af23fee 100644 (file)
@@ -1,5 +1,4 @@
 #include "builtin.h"
-#include "alloc.h"
 #include "config.h"
 #include "delta.h"
 #include "environment.h"
index 89442dcedae26e94b737d69bdec8ebe787a37642..38bd8df355dc540357e4a954cbd61ae783f9fbb6 100644 (file)
@@ -6,7 +6,6 @@
  */
 #include "git-compat-util.h"
 #include "abspath.h"
-#include "alloc.h"
 #include "config.h"
 #include "environment.h"
 #include "gettext.h"
index e381d5e5012c82bcba62c7e4cf655841c7af64bf..b2d5037dac719158c9e68296f3526ed5558096ad 100644 (file)
@@ -10,7 +10,6 @@
 #include "builtin.h"
 #include "abspath.h"
 #include "advice.h"
-#include "alloc.h"
 #include "config.h"
 #include "editor.h"
 #include "environment.h"
index 0eea810c7ea390995cb804f8c6c14e59a04244af..9a22d4e27735d55265fbf1a16cec8aeb66c27883 100644 (file)
@@ -4,7 +4,6 @@
  * Copyright (c) Junio C Hamano, 2006, 2009
  */
 #include "builtin.h"
-#include "alloc.h"
 #include "gettext.h"
 #include "hex.h"
 #include "quote.h"
index ae462bd7d4116748e1c647edfb508ac8cade20fe..fa84fcb20d8c95d16201c40afd88074f56a72e5e 100644 (file)
@@ -7,7 +7,6 @@
 #include "builtin.h"
 #include "abspath.h"
 #include "advice.h"
-#include "alloc.h"
 #include "config.h"
 #include "environment.h"
 #include "gettext.h"
index c3b722b36fcc8935b068e8a7239823bd0d03c333..c706fa37201aeabc5bdc3eb752a5be859490a42d 100644 (file)
@@ -1,5 +1,4 @@
 #include "builtin.h"
-#include "alloc.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
index 0d3f70093dc6a8c441d77b472a8390e642125af2..eab9a4f9bbeea88252bc30689b31e4e96cb89c6e 100644 (file)
@@ -1,5 +1,4 @@
 #include "builtin.h"
-#include "alloc.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
index a96e1c26382b2914ca2f5165bc4bac68d32dd6de..4afebfcbcf3a1891a6d117273bfeede777ae765c 100644 (file)
@@ -1,5 +1,4 @@
 #include "builtin.h"
-#include "alloc.h"
 #include "config.h"
 #include "dir.h"
 #include "environment.h"
index 3e2ee44177cd874fc918e961dc3a5306686103d0..434646b0742dce4e0ae85f9b8712878eb1b5e6da 100644 (file)
@@ -6,7 +6,6 @@
 #define USE_THE_INDEX_VARIABLE
 #include "builtin.h"
 #include "abspath.h"
-#include "alloc.h"
 #include "config.h"
 #include "commit.h"
 #include "environment.h"
index f6f07d9b539331f7717ccec8d8a2f287e7ad3be5..e6f9a1ad26721c450258849cb8e415156052e442 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "config.h"
 #include "builtin.h"
 #include "parse-options.h"
index 463eeabceaac3a47839733aee96ec14ff2863cfc..dff819ae5098ff2ee0c72bae00b35da39bf4979d 100644 (file)
@@ -5,7 +5,6 @@
  */
 #define USE_THE_INDEX_VARIABLE
 #include "builtin.h"
-#include "alloc.h"
 #include "advice.h"
 #include "config.h"
 #include "lockfile.h"
index 6321d7e9c9647d943a378b9d1c038cbe13012963..76d126ff67754d7d7545a1c9cde2d874a040418c 100644 (file)
@@ -1,7 +1,6 @@
 #define USE_THE_INDEX_VARIABLE
 #include "builtin.h"
 #include "abspath.h"
-#include "alloc.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
index fec68162591a86d8fb9f514f7741c4069c0689ec..73bff3a23d27bb2d9b6825bceccc9912aa2c50ce 100644 (file)
@@ -2,7 +2,6 @@
  * Copyright (c) 2011, Google Inc.
  */
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "bulk-checkin.h"
 #include "environment.h"
 #include "gettext.h"
index 84d7491420ed78c576e3370b500bc80b6c50f6df..641427ed410af39be80be22460a103dbad2d3d35 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "environment.h"
 #include "hex.h"
 #include "lockfile.h"
index e7d613c907e9f120109128b97f9e72038855d679..140dfa0dcc4629fec59f723d025ec36019ff29eb 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "chunk-format.h"
 #include "csum-file.h"
 #include "gettext.h"
index f15d84566bd6ed3e8a3a682cd96ac0b7bc9726ae..4b7c233fd468f9ad2a60abf5b9202f5c4fbad3c4 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "commit.h"
 #include "commit-graph.h"
 #include "decorate.h"
index 23aa1fcb005acb20d7730a159b19f76a7aa05d48..b3e5cc852612b200ea114aabe785455416599022 100644 (file)
--- a/config.c
+++ b/config.c
@@ -8,7 +8,6 @@
 #include "git-compat-util.h"
 #include "abspath.h"
 #include "advice.h"
-#include "alloc.h"
 #include "date.h"
 #include "branch.h"
 #include "config.h"
index 3722edf46c926e567cb93ca45a9e6d2ea6cfcef9..1edc9a85103bc953f76c391e0f7dc23f024d621b 100644 (file)
--- a/daemon.c
+++ b/daemon.c
@@ -1,6 +1,5 @@
 #include "git-compat-util.h"
 #include "abspath.h"
-#include "alloc.h"
 #include "config.h"
 #include "environment.h"
 #include "path.h"
index c824a5f6a42e56c04a46c8189d4fc1675fd172ea..332f0f7c455c438c203b1230ad369edce6f3b3d9 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "attr.h"
 #include "object.h"
 #include "blob.h"
diff --git a/diff.c b/diff.c
index d487438d70f072618643a2fc60dd7d98bd4d421c..150c1b8287932c19bf4901e2cf4269c14c4eac4c 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -3,7 +3,6 @@
  */
 #include "git-compat-util.h"
 #include "abspath.h"
-#include "alloc.h"
 #include "base85.h"
 #include "config.h"
 #include "convert.h"
index 926b554bd599a82f03799f5d8030794049ce8036..5a6e2bcac7147e487624c1bf53e1572a54b0d93d 100644 (file)
@@ -3,7 +3,6 @@
  * Copyright (C) 2005 Junio C Hamano
  */
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "diff.h"
 #include "diffcore.h"
 #include "object-store-ll.h"
index fb7c47f0e8a9516d17ded95d70e3dabaa61264bb..278b04243a3f40e63df433eea9549f90aed1c34d 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "dir.h"
 #include "iterator.h"
 #include "dir-iterator.h"
diff --git a/dir.c b/dir.c
index d270a1be360333a26f835357ccc418797e0f7120..c9dc69fc243daeed6daa0b1361107a641ea89257 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -7,7 +7,6 @@
  */
 #include "git-compat-util.h"
 #include "abspath.h"
-#include "alloc.h"
 #include "config.h"
 #include "convert.h"
 #include "dir.h"
index 12d6aa398e907f83eeaee9e9635ccbf11220ce35..7b525b1ecd896e02dfa71cdf3aab75496d998fac 100644 (file)
@@ -17,7 +17,6 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "ewok.h"
 
 #define EWAH_MASK(x) ((eword_t)1 << (x % BITS_IN_EWORD))
index c6d4ffc87cacaaaefb3edf4f81f62f7481b4b742..8785cbc54a821cd2cb89ba0226a29a233d8c19ff 100644 (file)
@@ -17,7 +17,6 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "ewok.h"
 #include "ewok_rlw.h"
 
index 84a24ff9b110e109713295025f159f7f957a6999..6198f3adafea0d4aa9a25994c12dbf4d3d6f4d0f 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "repository.h"
 #include "config.h"
 #include "date.h"
index 4da6c7a8bdab864dc19304ea1e660a807867182c..db2d3057575a9a3da2ee03bc0d5061260809bb1e 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "config.h"
 #include "environment.h"
 #include "refs.h"
diff --git a/fsck.c b/fsck.c
index a219d6f2c0ac087b50376944b6a08e235b7523b2..2035c4e00be8fa9944a9514e71b2058b3fbdc496 100644 (file)
--- a/fsck.c
+++ b/fsck.c
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "date.h"
 #include "dir.h"
 #include "hex.h"
index 9d3c21acbbb548a178c780aa6a1e81a054ecc0c0..0d0b42b2535afaf6e63964315d475c78866cbc5f 100644 (file)
@@ -1134,6 +1134,81 @@ static inline void move_array(void *dst, const void *src, size_t n, size_t size)
 #define FLEXPTR_ALLOC_STR(x, ptrname, str) \
        FLEXPTR_ALLOC_MEM((x), ptrname, (str), strlen(str))
 
+#define alloc_nr(x) (((x)+16)*3/2)
+
+/**
+ * Dynamically growing an array using realloc() is error prone and boring.
+ *
+ * Define your array with:
+ *
+ * - a pointer (`item`) that points at the array, initialized to `NULL`
+ *   (although please name the variable based on its contents, not on its
+ *   type);
+ *
+ * - an integer variable (`alloc`) that keeps track of how big the current
+ *   allocation is, initialized to `0`;
+ *
+ * - another integer variable (`nr`) to keep track of how many elements the
+ *   array currently has, initialized to `0`.
+ *
+ * Then before adding `n`th element to the item, call `ALLOC_GROW(item, n,
+ * alloc)`.  This ensures that the array can hold at least `n` elements by
+ * calling `realloc(3)` and adjusting `alloc` variable.
+ *
+ * ------------
+ * sometype *item;
+ * size_t nr;
+ * size_t alloc
+ *
+ * for (i = 0; i < nr; i++)
+ *     if (we like item[i] already)
+ *             return;
+ *
+ * // we did not like any existing one, so add one
+ * ALLOC_GROW(item, nr + 1, alloc);
+ * item[nr++] = value you like;
+ * ------------
+ *
+ * You are responsible for updating the `nr` variable.
+ *
+ * If you need to specify the number of elements to allocate explicitly
+ * then use the macro `REALLOC_ARRAY(item, alloc)` instead of `ALLOC_GROW`.
+ *
+ * Consider using ALLOC_GROW_BY instead of ALLOC_GROW as it has some
+ * added niceties.
+ *
+ * DO NOT USE any expression with side-effect for 'x', 'nr', or 'alloc'.
+ */
+#define ALLOC_GROW(x, nr, alloc) \
+       do { \
+               if ((nr) > alloc) { \
+                       if (alloc_nr(alloc) < (nr)) \
+                               alloc = (nr); \
+                       else \
+                               alloc = alloc_nr(alloc); \
+                       REALLOC_ARRAY(x, alloc); \
+               } \
+       } while (0)
+
+/*
+ * Similar to ALLOC_GROW but handles updating of the nr value and
+ * zeroing the bytes of the newly-grown array elements.
+ *
+ * DO NOT USE any expression with side-effect for any of the
+ * arguments.
+ */
+#define ALLOC_GROW_BY(x, nr, increase, alloc) \
+       do { \
+               if (increase) { \
+                       size_t new_nr = nr + (increase); \
+                       if (new_nr < nr) \
+                               BUG("negative growth in ALLOC_GROW_BY"); \
+                       ALLOC_GROW(x, new_nr, alloc); \
+                       memset((x) + nr, 0, sizeof(*(x)) * (increase)); \
+                       nr = new_nr; \
+               } \
+       } while (0)
+
 static inline char *xstrdup_or_null(const char *str)
 {
        return str ? xstrdup(str) : NULL;
diff --git a/help.c b/help.c
index 5d7637dce92867c1c0bee7f6f6b904852d237222..c81d43a5fa34e81dd594ab220805d1841fbf3b62 100644 (file)
--- a/help.c
+++ b/help.c
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "config.h"
 #include "builtin.h"
 #include "exec-cmd.h"
index 25a19c21b9c4ddfab91717b0b26bfb228539fd29..e24399ed1069588f9d9352f162e9bce5fc6b2379 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "config.h"
 #include "environment.h"
 #include "git-zlib.h"
index 2eff914bf369ee0d794294d8632e42bf58606f1d..790ab732127d04df57b330f06b43785532fd68b9 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "line-range.h"
 #include "hex.h"
 #include "tag.h"
index 2a3b7881af2bf5960dfbd41934aa3c66ad2a90eb..8a08b7af49c1ff7750296508102bf67807027bea 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "commit.h"
 #include "config.h"
 #include "gettext.h"
index e075a66c99d9f705bd0ca8ccaf9c79c1ca4448fd..9327ccd5057cb6fffc9fcd9a92f2939a50b50253 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "dir.h"
 #include "gettext.h"
 #include "hex.h"
diff --git a/midx.c b/midx.c
index db459e448b744fcaf8a60688e884617d0d03620e..3a16acabbcc3bebeb70961b1e1d058360a4c4c7e 100644 (file)
--- a/midx.c
+++ b/midx.c
@@ -1,6 +1,5 @@
 #include "git-compat-util.h"
 #include "abspath.h"
-#include "alloc.h"
 #include "config.h"
 #include "csum-file.h"
 #include "dir.h"
index 527b740018333b12cb7929e3d93878699b8dbc86..5ebe1b00c50e950b702640170d5bf23c59239a0f 100644 (file)
@@ -8,7 +8,6 @@
  */
 #include "git-compat-util.h"
 #include "abspath.h"
-#include "alloc.h"
 #include "config.h"
 #include "convert.h"
 #include "environment.h"
index e8228c777b1619d6bd1baaac0e24f14124d3e4d3..8e4717746c3183bd47c3c746c747efd83c61168c 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "oid-array.h"
 #include "hash-lookup.h"
 
index 7d57b7b19e364706f037ccb44388e00e901b1583..daef175dc71d6c7d55fc89ef1e286334afbe00b7 100644 (file)
--- a/oidtree.c
+++ b/oidtree.c
@@ -4,7 +4,6 @@
  */
 #include "git-compat-util.h"
 #include "oidtree.h"
-#include "alloc.h"
 #include "hash.h"
 
 struct oidtree_iter_data {
index d86f4e739a4b342374cdc97b607a1ed89d74bfa9..f6757c3cbf2019b7cf41b3d82e0861138c92c075 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
index 7367f62bb6ced4266e4bbf2d72445013315ddc00..01fbc0a6574bb368e329572120ae176a865a185b 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "commit.h"
 #include "gettext.h"
 #include "hex.h"
index ccab09fe654391ef8da95c4f4ecf0bf55d5f3df7..1b8052bececc1f9b0a2ef53f04d70334c1b57314 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "object.h"
 #include "pack.h"
 #include "pack-objects.h"
index 9126274b372975c2eadc6dbf0f5f85a6b29ad69d..030b7ec7a83627e9382c160618ba2eb53a59ea0f 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
index 8637723461b5ffc565e9559d406f1ebb8fe5b37e..b5a714c7111bda0d179077ef1614bbe5ce1570b5 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "config.h"
 #include "entry.h"
 #include "gettext.h"
index 2cf2cbbd0386e4a026d444f18badcecf00f154d8..d8407df04773dac913768e090c1d5ed3839ec58a 100644 (file)
--- a/pretty.c
+++ b/pretty.c
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "config.h"
 #include "commit.h"
 #include "environment.h"
index dc2476be53a30a6e9c682d934f620422dd855ada..450775a37492082130211431229ce5645ae17613 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "prio-queue.h"
 
 static inline int compare(struct prio_queue *queue, int i, int j)
diff --git a/quote.c b/quote.c
index 43c739671ed0cb33cd246a98737136b2154c2a57..3c05194496f65f879f437abd29823986ef118f47 100644 (file)
--- a/quote.c
+++ b/quote.c
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "path.h"
 #include "quote.h"
 #include "strbuf.h"
index 140b4f96a0c15ce357b4222b31d8311cb4efe6e5..53d71134e206246a5a0ed5939a6e085055f24807 100644 (file)
@@ -4,7 +4,6 @@
  * Copyright (C) Linus Torvalds, 2005
  */
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "bulk-checkin.h"
 #include "config.h"
 #include "date.h"
index e0d03a9f8e9f17124300557dba791d5c823f5a43..2ed0ecf26038fee6489a27dad66773305605baeb 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "environment.h"
 #include "gettext.h"
 #include "gpg-interface.h"
index d337e64431f702b084b8f0a41759d86a85945a72..d216f6f966da91459ea946790be56ba011760170 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "commit.h"
 #include "refs.h"
 #include "diff.h"
diff --git a/refs.c b/refs.c
index d5e0184ca5793f69847ec7210b03651c602cc970..c1b3d1f13ff6aaea6d1537e09bc9c1982a8e6de7 100644 (file)
--- a/refs.c
+++ b/refs.c
@@ -4,7 +4,6 @@
 
 #include "git-compat-util.h"
 #include "advice.h"
-#include "alloc.h"
 #include "config.h"
 #include "environment.h"
 #include "hashmap.h"
index 57f6c2aaf9bf2ad4d66bcbbc87c7d778383f172c..d60932f4ded876476b7dec21456b9088260d0d1f 100644 (file)
--- a/refspec.c
+++ b/refspec.c
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "gettext.h"
 #include "hash.h"
 #include "hex.h"
index acf7b2bb40ac4edc07e98934a51c4d69711bc6cb..8a976a0253252af3d6eeb11c85b3eba7aba7817e 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "config.h"
 #include "environment.h"
 #include "gettext.h"
index a81f2e2f17343ee006abe85e0344dac0ee2b1948..90f3e08b0d67e1e0348d454a5c23309e733c53e8 100644 (file)
--- a/remote.c
+++ b/remote.c
@@ -1,6 +1,5 @@
 #include "git-compat-util.h"
 #include "abspath.h"
-#include "alloc.h"
 #include "config.h"
 #include "environment.h"
 #include "gettext.h"
index 4227c9612a3ba8f7b063dadbf898d9783dc8c2b5..7070f75014da3302c239e31db359cb64a0404b2a 100644 (file)
--- a/rerere.c
+++ b/rerere.c
@@ -1,6 +1,5 @@
 #include "git-compat-util.h"
 #include "abspath.h"
-#include "alloc.h"
 #include "config.h"
 #include "copy.h"
 #include "gettext.h"
index 84768565cefa5253816ab0ca3bf0e03c11bc80b3..985b8b2f5150aba1a6a06482442aaaa3a1ec8eda 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "config.h"
 #include "environment.h"
 #include "gettext.h"
index 556bcabf90b34fdbc137f6bac4a238783c6d486a..2cc8fa0fbee50884542ef7f335b24ae679cb97d2 100644 (file)
@@ -1,7 +1,6 @@
 #include "git-compat-util.h"
 #include "abspath.h"
 #include "advice.h"
-#include "alloc.h"
 #include "config.h"
 #include "copy.h"
 #include "environment.h"
index f350713ecf5540487ef94a7be70734c792bcf990..e2fe0f91432d8089e74c7e562728aca329dec66c 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "dir.h"
 #include "environment.h"
 #include "hex.h"
index 2fad3504b73a70fd0100609422edad2d2c1e606f..5413719fd4ef16c130117440c4d4687f9c1c5525 100644 (file)
--- a/shallow.c
+++ b/shallow.c
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "hex.h"
 #include "repository.h"
 #include "tempfile.h"
index ee778c0580b6d9eb47ebc0d5f1ea7a9d7637a96c..66123bdbabb04123c6f0f4b64a8262584e3d2555 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "sigchain.h"
 
 #define SIGCHAIN_MAX_SIGNALS 32
index 90d046225683dd02b6593acc9413b1caecd0e12d..1fdb07a9e69be2db0b03d283f0f100a1d2842ad2 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "environment.h"
 #include "gettext.h"
 #include "name-hash.h"
index 0ee3865a553ae2676d6bf79279d221a8f000ee42..8c38687c04b81ceaa57746a96daf670874e31643 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "gettext.h"
 #include "hash.h"
 #include "mem-pool.h"
index 0158848dea5650aa3c690cdc08d7c33d891c5ce0..5d06ff026e4f316348e2aab341d38844d6d177db 100644 (file)
--- a/strbuf.c
+++ b/strbuf.c
@@ -1,6 +1,5 @@
 #include "git-compat-util.h"
 #include "abspath.h"
-#include "alloc.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
index 0f8ac117fd584828978568ff96ce21a63a8b160f..954569f381d8d7ea2e1c6f1333b1e8379ffe2fe8 100644 (file)
@@ -1,6 +1,5 @@
 #include "git-compat-util.h"
 #include "string-list.h"
-#include "alloc.h"
 
 void string_list_init_nodup(struct string_list *list)
 {
index 17d54b6c3bc500f7c8f927a702e1ec26ba66b7a1..89dc9e7e753313acbb0a5dc83b7705f3538a4c45 100644 (file)
--- a/strvec.c
+++ b/strvec.c
@@ -1,6 +1,5 @@
 #include "git-compat-util.h"
 #include "strvec.h"
-#include "alloc.h"
 #include "hex.h"
 #include "strbuf.h"
 
index 515ff5bba41c272e90bf9fd1f4681b4c65a16dd7..3b49ec13ea2bf7831536de00489e7f5f4ef47e58 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "dir.h"
 #include "environment.h"
 #include "gettext.h"
index f0f8788d2e34a0ee7fe1aa853cf8a7f1890abd6b..e603a19a876c88c59f18da33caa1541b15ded9f3 100644 (file)
@@ -1,6 +1,5 @@
 #include "git-compat-util.h"
 #include "abspath.h"
-#include "alloc.h"
 #include "repository.h"
 #include "config.h"
 #include "submodule-config.h"
index 5b6f2174418101575302a7fd083349414d6f283e..119f4908cf5b073ad482fd2a8811526949f9e748 100644 (file)
@@ -1,5 +1,4 @@
 #include "test-tool.h"
-#include "alloc.h"
 #include "commit.h"
 #include "commit-reach.h"
 #include "config.h"
index 9f46ae12f50f3ac9530db2d53879b03742f769fe..601c9e5036fb27a7f88957559f03821c2fffa4a2 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "thread-utils.h"
 #include "trace.h"
 #include "trace2/tr2_tls.h"
index a2c3ed6f28cc9fedffe50946acdb3594d21f9e7e..2170e01f6aee4241529e7cc7eeb2d648f44c7ad9 100644 (file)
--- a/trailer.c
+++ b/trailer.c
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "config.h"
 #include "environment.h"
 #include "gettext.h"
index 0a5794a944659f92b89e5c22d5d897041525e563..219af8fd50ed57c0fc0f954965e481b51e7aae72 100644 (file)
@@ -1,6 +1,5 @@
 #include "git-compat-util.h"
 #include "advice.h"
-#include "alloc.h"
 #include "config.h"
 #include "environment.h"
 #include "hex.h"
index 42ed86ef581ad745fabc6c919fce3c174ff45537..6c07913f3fe26030f79c793c741bda693bcccb1f 100644 (file)
@@ -1,6 +1,5 @@
 #include "git-compat-util.h"
 #include "tree-walk.h"
-#include "alloc.h"
 #include "dir.h"
 #include "gettext.h"
 #include "hex.h"
index 664c7c140256bb089d3e3920828ead185dfedd01..e399543823bdf2c0c8f24fb87f7622ac4d8a366b 100644 (file)
@@ -1,5 +1,4 @@
 #include "git-compat-util.h"
-#include "alloc.h"
 #include "config.h"
 #include "userdiff.h"
 #include "attr.h"
index 3c547bf109fc337ad684f01ffa0f8406bf4ca49d..2e7cd64509f21dafc4a4a67655003b290c5a5269 100644 (file)
@@ -1,6 +1,5 @@
 #include "git-compat-util.h"
 #include "abspath.h"
-#include "alloc.h"
 #include "environment.h"
 #include "gettext.h"
 #include "path.h"