]> git.ipfire.org Git - thirdparty/git.git/commit - mem-pool.h
block alloc: add validations around cache_entry lifecyle
authorJameson Miller <jamill@microsoft.com>
Mon, 2 Jul 2018 19:49:39 +0000 (19:49 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 3 Jul 2018 17:58:27 +0000 (10:58 -0700)
commit8616a2d0cb57865540f1c00ac2e5385a6cc5d84e
treeaa15c9800bf6305fd1dd5491b3abb2a591b1d089
parent8e72d67529ba0adfb6f7d24a21e909c2a1e1d069
block alloc: add validations around cache_entry lifecyle

Add an option (controlled by an environment variable) perform extra
validations on mem_pool allocated cache entries. When set:

  1) Invalidate cache_entry memory when discarding cache_entry.

  2) When discarding index_state struct, verify that all cache_entries
     were allocated from expected mem_pool.

  3) When discarding mem_pools, invalidate mem_pool memory.

This should provide extra checks that mem_pools and their allocated
cache_entries are being used as expected.

Signed-off-by: Jameson Miller <jamill@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache.h
git.c
mem-pool.c
mem-pool.h
read-cache.c