Skip to content

Commit 88cbd17

Browse files
committed
Merge branch 'ab/misc-cleanup'
Code clean-up. * ab/misc-cleanup: alloc.[ch]: remove alloc_report() function object-store.h: remove unused has_sha1_file*() pack-bitmap-write: remove unused bitmap_reset() function xdiff/xmacros.h: remove unused XDL_PTRFREE configure.ac: remove USE_PIC comment run-command.h: remove always unused "clean_on_exit_handler_cbdata"
2 parents e8005e4 + 0b75e5b commit 88cbd17

File tree

9 files changed

+0
-52
lines changed

9 files changed

+0
-52
lines changed

alloc.c

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ union any_object {
2727
};
2828

2929
struct alloc_state {
30-
int count; /* total number of nodes allocated */
3130
int nr; /* number of nodes left in current allocation */
3231
void *p; /* first free node in current allocation */
3332

@@ -63,7 +62,6 @@ static inline void *alloc_node(struct alloc_state *s, size_t node_size)
6362
s->slabs[s->slab_nr++] = s->p;
6463
}
6564
s->nr--;
66-
s->count++;
6765
ret = s->p;
6866
s->p = (char *)s->p + node_size;
6967
memset(ret, 0, node_size);
@@ -122,22 +120,3 @@ void *alloc_commit_node(struct repository *r)
122120
init_commit_node(c);
123121
return c;
124122
}
125-
126-
static void report(const char *name, unsigned int count, size_t size)
127-
{
128-
fprintf(stderr, "%10s: %8u (%"PRIuMAX" kB)\n",
129-
name, count, (uintmax_t) size);
130-
}
131-
132-
#define REPORT(name, type) \
133-
report(#name, r->parsed_objects->name##_state->count, \
134-
r->parsed_objects->name##_state->count * sizeof(type) >> 10)
135-
136-
void alloc_report(struct repository *r)
137-
{
138-
REPORT(blob, struct blob);
139-
REPORT(tree, struct tree);
140-
REPORT(commit, struct commit);
141-
REPORT(tag, struct tag);
142-
REPORT(object, union any_object);
143-
}

alloc.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ void init_commit_node(struct commit *c);
1313
void *alloc_commit_node(struct repository *r);
1414
void *alloc_tag_node(struct repository *r);
1515
void *alloc_object_node(struct repository *r);
16-
void alloc_report(struct repository *r);
1716

1817
struct alloc_state *allocate_alloc_state(void);
1918
void clear_alloc_state(struct alloc_state *s);

configure.ac

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,9 +1189,6 @@ AC_COMPILE_IFELSE([BSD_SYSCTL_SRC],
11891189
GIT_CONF_SUBST([HAVE_BSD_SYSCTL])
11901190

11911191
## Other checks.
1192-
# Define USE_PIC if you need the main git objects to be built with -fPIC
1193-
# in order to build and link perl/Git.so. x86-64 seems to need this.
1194-
#
11951192
# Define NO_SYMLINK_HEAD if you never want .git/HEAD to be a symbolic link.
11961193
# Enable it on Windows. By default, symrefs are still used.
11971194
#

contrib/coccinelle/the_repository.pending.cocci

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,6 @@ expression G;
1111
+ repo_read_object_file(the_repository,
1212
E, F, G)
1313

14-
@@
15-
expression E;
16-
@@
17-
- has_sha1_file(
18-
+ repo_has_sha1_file(the_repository,
19-
E)
20-
21-
@@
22-
expression E;
23-
expression F;
24-
@@
25-
- has_sha1_file_with_flags(
26-
+ repo_has_sha1_file_with_flags(the_repository,
27-
E)
28-
2914
@@
3015
expression E;
3116
@@

ewah/bitmap.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -216,11 +216,6 @@ int bitmap_is_subset(struct bitmap *self, struct bitmap *other)
216216
return 0;
217217
}
218218

219-
void bitmap_reset(struct bitmap *bitmap)
220-
{
221-
memset(bitmap->words, 0x0, bitmap->word_alloc * sizeof(eword_t));
222-
}
223-
224219
void bitmap_free(struct bitmap *bitmap)
225220
{
226221
if (bitmap == NULL)

ewah/ewok.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ struct bitmap *bitmap_dup(const struct bitmap *src);
177177
void bitmap_set(struct bitmap *self, size_t pos);
178178
void bitmap_unset(struct bitmap *self, size_t pos);
179179
int bitmap_get(struct bitmap *self, size_t pos);
180-
void bitmap_reset(struct bitmap *self);
181180
void bitmap_free(struct bitmap *self);
182181
int bitmap_equals(struct bitmap *self, struct bitmap *other);
183182
int bitmap_is_subset(struct bitmap *self, struct bitmap *other);

object-store.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,6 @@ int has_object(struct repository *r, const struct object_id *oid,
312312
* These functions can be removed once all callers have migrated to
313313
* has_object() and/or oid_object_info_extended().
314314
*/
315-
#ifndef NO_THE_REPOSITORY_COMPATIBILITY_MACROS
316-
#define has_sha1_file_with_flags(sha1, flags) repo_has_sha1_file_with_flags(the_repository, sha1, flags)
317-
#define has_sha1_file(sha1) repo_has_sha1_file(the_repository, sha1)
318-
#endif
319315
int repo_has_object_file(struct repository *r, const struct object_id *oid);
320316
int repo_has_object_file_with_flags(struct repository *r,
321317
const struct object_id *oid, int flags);

run-command.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ struct child_process {
142142
unsigned clean_on_exit:1;
143143
unsigned wait_after_clean:1;
144144
void (*clean_on_exit_handler)(struct child_process *process);
145-
void *clean_on_exit_handler_cbdata;
146145
};
147146

148147
#define CHILD_PROCESS_INIT { \

xdiff/xmacros.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
#define XDL_ADDBITS(v,b) ((v) + ((v) >> (b)))
3535
#define XDL_MASKBITS(b) ((1UL << (b)) - 1)
3636
#define XDL_HASHLONG(v,b) (XDL_ADDBITS((unsigned long)(v), b) & XDL_MASKBITS(b))
37-
#define XDL_PTRFREE(p) do { if (p) { xdl_free(p); (p) = NULL; } } while (0)
3837
#define XDL_LE32_PUT(p, v) \
3938
do { \
4039
unsigned char *__p = (unsigned char *) (p); \

0 commit comments

Comments
 (0)