GNU bug report logs - #6524
du now uses less than half as much memory, sometimes

Previous Next

Package: coreutils;

Reported by: Jim Meyering <jim <at> meyering.net>

Date: Sun, 27 Jun 2010 22:10:02 UTC

Severity: normal

Done: Jim Meyering <jim <at> meyering.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> CS.UCLA.EDU>
To: Jim Meyering <jim <at> meyering.net>
Cc: 6524 <at> debbugs.gnu.org
Subject: bug#6524: du now uses less than half as much memory, sometimes
Date: Thu, 08 Jul 2010 11:18:25 -0700
On 07/07/10 03:03, Jim Meyering wrote:

> Do you know of any system on which sizeof dev_t is larger
> than two times sizeof size_t?  I was wondering if the added
> (sizeof dev % sizeof h != 0) term is actually necessary anywhere.
> The largest dev_t I've seen is 8 bytes wide.  Just curious.
> I know it is required, just in case.

I don't know of any, no.  I imagine there may be some hosts
that have 16-bit size_t and 64-bit ino_t, but the GNU coding standards
say that we don't have to worry about such hosts.  The general-case
code is mainly there to document the general case and to make it
clear what the intent is: I can't imagine any host where the
(sizeof dev % sizeof h != 0) term is actually needed.

It's just a hash function, so the code will still work even
if the loop is removed completely; but it won't hash nearly
as well on Cygwin, I expect.




This bug report was last modified 14 years and 99 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.