@@ -63,13 +63,6 @@ static inline struct llist_item *llist_item_get(void)
6363 return new_item ;
6464}
6565
66- static inline void llist_init (struct llist * * list )
67- {
68- * list = xmalloc (sizeof (struct llist ));
69- (* list )-> front = (* list )-> back = NULL ;
70- (* list )-> size = 0 ;
71- }
72-
7366static void llist_free (struct llist * list )
7467{
7568 for (struct llist_item * i = list -> front , * next ; i ; i = next ) {
@@ -84,7 +77,7 @@ static struct llist * llist_copy(struct llist *list)
8477 struct llist * ret ;
8578 struct llist_item * new_item , * old_item , * prev ;
8679
87- llist_init ( & ret );
80+ CALLOC_ARRAY ( ret , 1 );
8881
8982 if ((ret -> size = list -> size ) == 0 )
9083 return ret ;
@@ -480,7 +473,7 @@ static void load_all_objects(void)
480473 struct pack_list * pl = local_packs ;
481474 struct llist_item * hint , * l ;
482475
483- llist_init ( & all_objects );
476+ CALLOC_ARRAY ( all_objects , 1 );
484477
485478 while (pl ) {
486479 hint = NULL ;
@@ -507,7 +500,7 @@ static void cmp_local_packs(void)
507500
508501 /* only one packfile */
509502 if (!pl -> next ) {
510- llist_init ( & pl -> unique_objects );
503+ CALLOC_ARRAY ( pl -> unique_objects , 1 );
511504 return ;
512505 }
513506
@@ -544,7 +537,7 @@ static struct pack_list * add_pack(struct packed_git *p)
544537 return NULL ;
545538
546539 l .pack = p ;
547- llist_init ( & l .remaining_objects );
540+ CALLOC_ARRAY ( l .remaining_objects , 1 );
548541
549542 if (open_pack_index (p ))
550543 return NULL ;
@@ -650,7 +643,7 @@ int cmd_pack_redundant(int argc, const char **argv, const char *prefix UNUSED, s
650643 scan_alt_odb_packs ();
651644
652645 /* ignore objects given on stdin */
653- llist_init ( & ignore );
646+ CALLOC_ARRAY ( ignore , 1 );
654647 if (!isatty (0 )) {
655648 struct object_id oid ;
656649 while (fgets (buf , sizeof (buf ), stdin )) {
0 commit comments