Re: [PATCH 01/41] cache: add a function to read an object ID from a buffer

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

 



On Mon, Apr 23, 2018 at 11:39:11PM +0000, brian m. carlson wrote:
> diff --git a/cache.h b/cache.h
> index bbaf5c349a..4bca177cf3 100644
> --- a/cache.h
> +++ b/cache.h
> @@ -1008,6 +1008,11 @@ static inline void oidclr(struct object_id *oid)
>  	memset(oid->hash, 0, GIT_MAX_RAWSZ);
>  }
>  
> +static inline void oidread(struct object_id *oid, const unsigned char *hash)
> +{
> +	memcpy(oid->hash, hash, the_hash_algo->rawsz);

If performance is a concern, should we go with GIT_MAX_RAWSZ instead
of the_hash_algo->rawsz which gives the compiler some more to bypass
actual memcpy function and generate copy code directly?

If it is not a performance problem, should we avoid inline and move
the implementation somewhere?

> +}
> +
>  



[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]

  Powered by Linux