Re: [patch] git: fix memory leak #2 in read-cache.c
- From
- Ingo Molnar <mingo@elte.hu>
- Date
- Apr 14, 2005, 15:14 UTC
- Message-ID
- <20050414151456.GA11385@elte.hu>
- In-Reply-To
- <Pine.LNX.4.58.0504140804480.7211@ppc970.osdl.org>
* Linus Torvalds <torvalds@osdl.org> wrote:
Show 12 quoted lines
> 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 an existing entry > that was allocated with malloc(), unless the user does something > stupid. In other words, the only case where there is a "leak" is when > the user does something like > > update-cache file file file file file file .. > > with the same file listed several times.
fair enough - as long as this is only used in a scripted environment, and not via some library and not within a repository server, web backend, etc.
Ingo