NetBSD-Bugs archive

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

Re: kern/50571: src/sys/fs/udf/udf_subr.c:6465: obvious performance tidyup



The following reply was made to PR kern/50571; it has been noted by GNATS.

From: Robert Elz <kre%munnari.OZ.AU@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: kern/50571: src/sys/fs/udf/udf_subr.c:6465: obvious performance tidyup
Date: Sat, 19 Dec 2015 04:23:36 +0700

     Date:        Fri, 18 Dec 2015 20:55:00 +0000 (UTC)
     From:        dcb314%hotmail.com@localhost
     Message-ID:  <20151218205500.69D4A7AC07%mollari.NetBSD.org@localhost>
 
   | Maybe better code
   | 
   |     assert(inflen < sector_size);
   | 
   |     /* copy out info */
   |     memcpy(blob, pos, inflen);
   |     memset(&blob[inflen] 0, sector_size - inflen);
 
 That wouldn't be enough, you'd also need
 
 	memset(blob, 0, pos);
 
 But unless inflen is likely to be of a magnitde comparable to sector_size,
 and unless both a relatively large (or likely to be) then I don't think
 any change is worth the bother.
 
 Clearing an entire struct/array before then assigning other values to some
 elements is standard practice - if this is offending any automated checking
 code, that ought to be fixed.   If it is just your sensibilities, get over
 it.
 
 kre
 
 


Home | Main Index | Thread Index | Old Index