[Gluster-devel] regarding mem_0filled, iov_0filled and memdup

Pranith Kumar Karampuri pkarampu at redhat.com
Fri May 22 04:27:17 UTC 2015


hi,
    These functions return 0 when 0filled and non-zero value when not 
0filled. This is quite unintuitive as people think that it should return 
_gf_true when 0filled and false when it is not 0filled. This comes up as 
bug in reviews quite a few times, so decided may be it is better to 
change the api itself. What do you say?

    Along the same lines is memdup. It is a function in common-utils 
which does GF_CALLOC, so the memory needs to be freed with GF_FREE. But 
since it sounds so much like standard api, I have seen people do free 
instead of GF_FREE. May be it is better to change it to gf_memdup?

Pranith


More information about the Gluster-devel mailing list