* ce_stage(..) == 2?
@ 2010-02-15 6:48 cg
2010-02-15 6:53 ` Junio C Hamano
0 siblings, 1 reply; 2+ messages in thread
From: cg @ 2010-02-15 6:48 UTC (permalink / raw)
To: git
Hi,
I saw some code like:
attr.c(365): if (ce_stage(istate->cache[i]) == 2)
...
rerere.c(352): if (ce_stage(e2) == 2
...
but there is no 0x200 in cache.h(158):
#define CE_NAMEMASK (0x0fff)
#define CE_STAGEMASK (0x3000)
#define CE_EXTENDED (0x4000)
#define CE_VALID (0x8000)
#define CE_STAGESHIFT 12
so what does "2" mean?
Thanks
cg
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: ce_stage(..) == 2?
2010-02-15 6:48 ce_stage(..) == 2? cg
@ 2010-02-15 6:53 ` Junio C Hamano
0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2010-02-15 6:53 UTC (permalink / raw)
To: chengang31; +Cc: git
cg <chengang31@gmail.com> writes:
> I saw some code like:
> attr.c(365): if (ce_stage(istate->cache[i]) == 2)
> ...
> rerere.c(352): if (ce_stage(e2) == 2
> ...
>
> but there is no 0x200 in cache.h(158):
> #define CE_NAMEMASK (0x0fff)
> #define CE_STAGEMASK (0x3000)
> #define CE_EXTENDED (0x4000)
> #define CE_VALID (0x8000)
> #define CE_STAGESHIFT 12
>
> so what does "2" mean?
#define ce_stage(ce) ((CE_STAGEMASK & (ce)->ce_flags) >> CE_STAGESHIFT)
0x3000 shifted 12 places is a mask for two bits, as you can have cache
entries at stage 0 (normal), or stage 1/2/3.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-02-15 6:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-15 6:48 ce_stage(..) == 2? cg
2010-02-15 6:53 ` Junio C Hamano
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).