Teach notes code to free its internal data structures on request
There's no need to be rude to memory-concious callers... This patch has been improved by the following contributions: - Junio C Hamano: avoid old-style declaration Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
8b208f0213
commit
27d5756410
7
notes.c
7
notes.c
@ -105,6 +105,13 @@ static unsigned char *lookup_notes(const unsigned char *commit_sha1)
|
|||||||
return hash_map.entries[index].notes_sha1;
|
return hash_map.entries[index].notes_sha1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void free_notes(void)
|
||||||
|
{
|
||||||
|
free(hash_map.entries);
|
||||||
|
memset(&hash_map, 0, sizeof(struct hash_map));
|
||||||
|
initialized = 0;
|
||||||
|
}
|
||||||
|
|
||||||
void get_commit_notes(const struct commit *commit, struct strbuf *sb,
|
void get_commit_notes(const struct commit *commit, struct strbuf *sb,
|
||||||
const char *output_encoding, int flags)
|
const char *output_encoding, int flags)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user