Re: [PATCH 7/7] commit-tree: free commit message before exiting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano wrote:

> Read what the code does (e.g. calling
> git-config, showing usage or dying on sick arguments, etc.).  So I have to
> say that the proposed commit log message advertises a benefit that it does
> not bring.

Yep, that was sloppy of me.  commit-tree has already been libified.

> By the way, is there an easy and concise way to tell valgrind to
> 
>  (1) treat allocations made in main() that are not freed as non-issues;
>      and
> 
>  (2) treat functions whose name begin with cmd_ as if they are all their
>      own main(), and apply the above special casing to them?

As long as the term "allocation" is defined clearly.  For example
(written in the modern syntax for conciseness):

	{
		xmalloc from main()
		Memcheck:Leak
		...
		fun:xmalloc
		fun:main
	}
	{
		xmalloc from built-in main
		Memcheck:Leak
		...
		fun:xmalloc
		fun:cmd_*
	}

Even better would be to exit() instead of returning from cmd_
functions.  Valgrind will not consider any memory that still has a
pointer to it at exit time as a leak.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]