diff options
author | Jeff King <peff@peff.net> | 2016-08-22 17:59:42 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-08-23 14:52:00 -0700 |
commit | 12d95ef6fcc1f0b83b24e926f488c6416c08d79c (patch) | |
tree | 06bbfe3fb4dee00769d8aa9e2e0655d69ce21b32 /t/t0110/url-11 | |
parent | release_delta_base_cache: reuse existing detach function (diff) | |
download | tgif-12d95ef6fcc1f0b83b24e926f488c6416c08d79c.tar.xz |
delta_base_cache: use list.h for LRU
We keep an LRU list of entries for when we need to drop
something from an over-full cache. The list is implemented
as a circular doubly-linked list, which is exactly what
list.h provides. We can save a few lines by using the list.h
macros and functions. More importantly, this makes the code
easier to follow, as the reader sees explicit concepts like
"list_add_tail()" instead of pointer manipulation.
As a bonus, the list_entry() macro lets us place the lru
pointers anywhere inside the delta_base_cache_entry struct
(as opposed to just casting the pointer, which requires it
at the front of the struct). This will be useful in later
patches when we need to place other items at the front of
the struct (e.g., our hashmap implementation requires this).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0110/url-11')
0 files changed, 0 insertions, 0 deletions