Re: [PATCH] reftable: pass pq_entry by address

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

 



Elijah Conners <business@xxxxxxxxxxxxxx> writes:

> In merged_iter_pqueue_add, the pq_entry parameter is passed by value,
> although it exceeds 64 bytes.

Do we have any hard guidance like "do not pass an data item whose
size is larger than 64 bytes" in our coding guidelines?  If not,
make sure that the reference to 64 bytes does not look like one.

While this patch is not bad as a change, we are going to make a copy
of the value with structure assignment at the leaf level, I am not
sure how big a deal this is in practice.

In any case, wouldn't it make sense to make the "we pass reference
not because we want to let the callee modify the value, but because
the callee deep in the callchain wants to copy the contents out of
it" parameter a pointer to a constant?  I.e.

    void merged_iter_pqueue_add(struct merged_iter_pqueue *pq, const struct pq_entry *e)

Other than that, looking good.



[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