filter-options: expand scaled numbers
[gitweb.git] / pack-objects.h
index 9e6af3f24f993e76f6b391c5c03ee9df88a8fd72..3cd8d1f00a95978a5a8c86805506b9927aefcd0e 100644 (file)
@@ -148,9 +148,7 @@ struct packing_data {
        struct packed_git **in_pack_by_idx;
        struct packed_git **in_pack;
 
-#ifndef NO_PTHREADS
        pthread_mutex_t lock;
-#endif
 
        /*
         * This list contains entries for bases which we know the other side
@@ -172,15 +170,11 @@ void prepare_packing_data(struct repository *r, struct packing_data *pdata);
 
 static inline void packing_data_lock(struct packing_data *pdata)
 {
-#ifndef NO_PTHREADS
        pthread_mutex_lock(&pdata->lock);
-#endif
 }
 static inline void packing_data_unlock(struct packing_data *pdata)
 {
-#ifndef NO_PTHREADS
        pthread_mutex_unlock(&pdata->lock);
-#endif
 }
 
 struct object_entry *packlist_alloc(struct packing_data *pdata,
@@ -421,7 +415,7 @@ static inline void oe_set_tree_depth(struct packing_data *pack,
                                     unsigned int tree_depth)
 {
        if (!pack->tree_depth)
-               ALLOC_ARRAY(pack->tree_depth, pack->nr_objects);
+               CALLOC_ARRAY(pack->tree_depth, pack->nr_alloc);
        pack->tree_depth[e - pack->objects] = tree_depth;
 }
 
@@ -438,7 +432,7 @@ static inline void oe_set_layer(struct packing_data *pack,
                                unsigned char layer)
 {
        if (!pack->layer)
-               ALLOC_ARRAY(pack->layer, pack->nr_objects);
+               CALLOC_ARRAY(pack->layer, pack->nr_alloc);
        pack->layer[e - pack->objects] = layer;
 }