mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
attr: eliminate global check_all_attr array
Currently there is a reliance on 'check_all_attr' which is a global array of 'attr_check_item' items which is used to store the value of each attribute during the collection process. This patch eliminates this global and instead creates an array per 'attr_check' instance which is then used in the attribute collection process. This brings the attribute system one step closer to being thread-safe. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
1a600b7555
commit
685b292575
5
attr.h
5
attr.h
@@ -4,6 +4,9 @@
|
||||
/* An attribute is a pointer to this opaque structure */
|
||||
struct git_attr;
|
||||
|
||||
/* opaque structure used internally for attribute collection */
|
||||
struct all_attrs_item;
|
||||
|
||||
/*
|
||||
* Given a string, return the gitattribute object that
|
||||
* corresponds to it.
|
||||
@@ -33,6 +36,8 @@ struct attr_check {
|
||||
int nr;
|
||||
int alloc;
|
||||
struct attr_check_item *items;
|
||||
int all_attrs_nr;
|
||||
struct all_attrs_item *all_attrs;
|
||||
};
|
||||
|
||||
extern struct attr_check *attr_check_alloc(void);
|
||||
|
||||
Reference in New Issue
Block a user