[PATCH] bisect: save heap memory. allocate only the required amount

2014-08-24 Thread Arjun Sreedharan
Find and allocate the required amount instead of allocating extra 100 bytes Signed-off-by: Arjun Sreedharan --- bisect.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bisect.c b/bisect.c index d6e851d..c96aab0 100644 --- a/bisect.c +++ b/bisect.c @@ -215,10 +215,13

[PATCH] bisect: save heap memory. allocate only the required amount

2014-08-24 Thread Arjun Sreedharan
find and allocate the required amount instead of allocating extra 100 bytes Signed-off-by: Arjun Sreedharan --- bisect.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bisect.c b/bisect.c index d6e851d..a52631e 100644 --- a/bisect.c +++ b/bisect.c @@ -215,12 +215,16

Re: [PATCH] bisect: save heap memory. allocate only the required amount

2014-08-25 Thread Arjun Sreedharan
On 26 August 2014 01:05, Jeff King wrote: > On Mon, Aug 25, 2014 at 11:26:39AM -0700, Junio C Hamano wrote: > >> Good digging, and I agree that it should use the FLEX_ARRAY for >> consistency. > > I can produce a patch, but I did not want to steal Arjun's thunder. Please feel free to do so. > >

Re: [PATCH] bisect: save heap memory. allocate only the required amount

2014-08-26 Thread Arjun Sreedharan
On 26 August 2014 02:44, Junio C Hamano wrote: > Arjun Sreedharan writes: > >> Find and allocate the required amount instead of allocating extra >> 100 bytes >> >> Signed-off-by: Arjun Sreedharan >> --- > > Interesting. How much memory do we typically

[PATCH] fix calloc() and xcalloc() argument ordering

2014-08-29 Thread Arjun Sreedharan
@number first, @size second argument. Signed-off-by: Arjun Sreedharan --- builtin/for-each-ref.c| 2 +- compat/regex/regcomp.c| 12 ++-- compat/regex/regex_internal.c | 4 ++-- compat/regex/regexec.c| 10 +- imap-send.c | 2 +- 5

Re: [PATCH] fix calloc() and xcalloc() argument ordering

2014-09-02 Thread Arjun Sreedharan
On 3 September 2014 00:12, Junio C Hamano wrote: > Arjun Sreedharan writes: > >> @number first, @size second argument. >> >> Signed-off-by: Arjun Sreedharan >> --- >> builtin/for-each-ref.c| 2 +- > > Thanks. compat/regex/ being borrowed co

[PATCH] fix calloc() and xcalloc() argument ordering

2014-09-04 Thread Arjun Sreedharan
@number first, @size second argument. Signed-off-by: Arjun Sreedharan --- builtin/for-each-ref.c | 2 +- imap-send.c| 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/for-each-ref.c b/builtin/for-each-ref.c index 47bd624..69bba06 100644 --- a/builtin/for

[PATCH] introduce git root

2014-11-29 Thread Arjun Sreedharan
This introduces `git root` which outputs the root directory (the directory that contains .git). The same can be accomplished by `git rev-parse --show-toplevel`. `git root` is much more intuitive and easy to remember. All it does is set the arguments for rev-parse Signed-off-by: Arjun Sreedharan

Re: [PATCH] introduce git root

2014-11-29 Thread Arjun Sreedharan
On 30 November 2014 at 04:38, Philip Oakley wrote: > From: "Arjun Sreedharan" >> >> This introduces `git root` which outputs the root directory >> (the directory that contains .git). >> The same can be accomplished by `git rev-parse --show-toplevel`. >>

[PATCH] win32: syslog: prevent potential realloc memory leak

2014-12-13 Thread Arjun Sreedharan
use a temporary variable to free the memory in case realloc() fails. Signed-off-by: Arjun Sreedharan --- compat/win32/syslog.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compat/win32/syslog.c b/compat/win32/syslog.c index d015e43..3409e43 100644 --- a/compat/win32