]> git.ipfire.org Git - thirdparty/git.git/commit - attr.h
attr: store attribute stack in attr_check structure
authorBrandon Williams <bmwill@google.com>
Sat, 28 Jan 2017 02:02:05 +0000 (18:02 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 1 Feb 2017 21:46:53 +0000 (13:46 -0800)
commitdc81cf377cd25193a9cf044767917e4f5553c285
treec5e941a96229ac5a008b3d538e809f89dbc51093
parente810e0635767afbc9b304d5256fbdb26b59644fa
attr: store attribute stack in attr_check structure

The last big hurdle towards a thread-safe API for the attribute system
is the reliance on a global attribute stack that is modified during each
call into the attribute system.

This patch removes this global stack and instead a stack is stored
locally in each attr_check instance.  This opens up the opportunity for
future optimizations to customize the attribute stack for the attributes
that a particular attr_check struct is interested in.

One caveat with pushing the attribute stack into the attr_check
structure is that the attribute system now needs to keep track of all
active attr_check instances.  Due to the direction mechanism the stack
needs to be dropped when the direction is switched.  In order to ensure
correctness when the direction is changed the attribute system needs to
iterate through all active attr_check instances and drop each of their
stacks.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
attr.c
attr.h