Re: [patch] git: fix memory leak #2 in read-cache.c

2005-04-14 Thread Ingo Molnar
* Linus Torvalds <[EMAIL PROTECTED]> wrote: > In other words, if the common case is that we update a couple of > entries in the active cache, we actually saved 1.6MB (+ malloc > overhead for the 17 _thousand_ allocations) by my approach. > > And the leak? There's none. We never actually update

Re: [patch] git: fix memory leak #2 in read-cache.c

2005-04-14 Thread Linus Torvalds
On Thu, 14 Apr 2005, Ingo Molnar wrote: > > this patch fixes a memory leak in read-cache.c: when there's cache entry > collision we should free the previous one. As you already noticed "read_cache()" normally just populates the active-cache with pointers to the mmap'ed "active" file. Whether

Re: [patch] git: fix memory leak #2 in read-cache.c

2005-04-14 Thread Martin Schlemmer
On Thu, 2005-04-14 at 15:25 +0200, Ingo Molnar wrote: > * Ingo Molnar <[EMAIL PROTECTED]> wrote: > > > this patch fixes a memory leak in read-cache.c: when there's cache > > entry collision we should free the previous one. > > > + free(active_cache[pos]); > > active_cache[p

Re: [patch] git: fix memory leak #2 in read-cache.c

2005-04-14 Thread Ingo Molnar
* Ingo Molnar <[EMAIL PROTECTED]> wrote: > this patch fixes a memory leak in read-cache.c: when there's cache > entry collision we should free the previous one. > + free(active_cache[pos]); > active_cache[pos] = ce; i'm having second thoughs about this one: active_cac