Re: [PATCH 00/15] Rearrange xcalloc arguments

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

 



Brian,

On Tue, May 27, 2014 at 12:33:41AM +0900, Brian Gesiak wrote:
> xcalloc takes two arguments: the number of elements and their size.
> The vast majority of the Git codebase passes these arguments in the
> correct order, but there are some exceptions. This patch series
> corrects those exceptions.
> 

Let me see if I understand the issue underlying this patch set.

xcalloc works like calloc and takes two arguments, the number of
elements and the size of each element.  However, many calls specified
these arguments in the reverse order.  It didn't produce a compile
error because both arguments are the same type.  And it didn't produce
a run time error because A*B is the same as B*A.

If this behaved like dd, performance would be different depending on the
order.

  dd if=in of=out bs=1    count=1024
  dd if=in of=out bs=1024 count=1

Nonetheless, it appears to be a good fix.  Nice job!

-- 
Jeremiah Mahler
jmmahler@xxxxxxxxx
http://github.com/jmahler
--
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]