Re: [PATCH v2 5/7] name-hash: perf improvement for lazy_init_name_hash

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

 





On 3/23/2017 1:45 PM, Stefan Beller wrote:
On Thu, Mar 23, 2017 at 8:25 AM, Ramsay Jones
<ramsay@xxxxxxxxxxxxxxxxxxxx> wrote:
+     /*
+      * Either we have a parent directory and path with slash(es)
+      * or the directory is an immediate child of the root directory.
+      */
+     assert((parent != NULL) ^ (strchr(prefix->buf, '/') == 0));


Also this seems part of the actual shipped code, not testing code.
In that case we prefer

    if (<condition>)
        die("BUG: <description>");

This is because asserts may be omitted by the compiler,
when compiled with NDEBUG.

I mainly wrote that for myself while testing.  Now that I'm
past that, I'm comfortable removing it completely or converting
it to an actual if-die.

Jeff



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