| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
bftw() implements depth-first search by appending files to a batch, then
prepending the batch to the queue. When we switched to separate file/
directory queues, this was only implemented for the file queue.
Unbuffered searches don't use the file queue, so they were all breadth-
first in practice.
This meant that iterative deepening (-S ids) was actually "iterative
deepening *breadth*-first search," a horrible strategy with no advantage
over regular breadth-first search. Now it performs iterative deepening
*depth*-first search, which at least limits its memory consumption.
Fixes: c1b16b49988ecff17ae30978ea14798d95b80018
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Clang still thinks that alignof(dstr[1]) == 2, so out of an abundance of
caution, don't mess with dchar alignment in normal builds.
|
|
|
|
| |
call_once() is a reserved identifier from C11.
|
|
|
|
| |
Closes #65.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
This makes everything usable in expression contexts.
|
| |
|
|
|
|
|
|
|
|
| |
Fewer than 3 can lead to
Assertion failed: (retval->write_queue != -1), function __open_cached_connection, file /usr/src/lib/libc/net/nscachedcli.c, line 224.
on a FreeBSD system with LDAP accounts.
|
| |
|
|
|
|
| |
Link: https://github.com/llvm/llvm-project/issues/65532
|
| |
|
|
|
|
|
|
|
| |
If xmbrtowc() fails, or if xiswprint() is false, then we shouldn't
include that wide char in the printable length.
Fixes: 19c96abe0a1ee56cf206fd5e87defb1fd3e0daa5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This bug could be reproduced with something like
$ bfs -samefile $'\xFA\xFA'
bfs: error: bfs: dstrnescat@src/dstring.c:252: wordesc() result truncated
or worse, with -DNDEBUG,
$ bfs -samefile $'.....................\xFA\xFA'
bfs: error: bfs -samefile $'.....................\xFA\xFA\x00\x55\x53\x45\x52\x3D\x74\x61\x76\x69\x61\x6E\x61\x74\x6F\x72
bfs: error: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bfs: error: No such file or directory.
which prints the memory after the end of the string (in this case, the
environment variable USER=tavianator).
The bug was caused by the line `*i += len`, which was intended to be
`*i = len`. But actually, the right behaviour seems to be `*i += 1`.
Fixes: 19c96abe0a1ee56cf206fd5e87defb1fd3e0daa5
|
|
|
|
|
|
| |
The previous accounting didn't fully control the number of allocated
bfs_dirs, as the dirlimit was incremented once we popped the directory,
not when we freed it.
|
|
|
|
|
| |
They tend be 1024, which is a lot of memory per user/group. 128 is
usually enough, so start there instead.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
This follows a behaviour change in GNU findutils 4.9.0.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
I see this only with musl-gcc for some reason.
|
| |
|
|
|
|
|
| |
A file can be on the to_open and to_read lists at the same time, but
otherwise only one list, so we can save memory by sharing the pointers.
|
|
|
|
|
|
|
| |
Now that the dirlimit provides backpressure on the number of open
directories, we can use a uniformly larger queue depth for increased
performance. The current parameters were tuned with a small grid search
on my workstation.
|
|
|
|
|
|
|
|
| |
For !BFS_USE_UNWRAPDIR, if a file is still pinned in bftw_closedir(), it
has to stay open until its pincount drops to zero. Since this happens
in bftw_ioq_pop(), we can't immediately call bftw_unwrapdir() as that
adds to the ioq. Instead, add it to a list that gets drained by the
next bftw_gc().
|
|
|
|
|
|
| |
I tried this before in #105 but it led to performance regressions. The
key to avoiding those regressions is to put some backpressure on how
many bfs_dir's can be allocated simultaneously.
|
| |
|
|
|
|
|
|
|
| |
This has the potential to fail on at least one known platform: macports
with the legacysupport implementation of fdopendir().
Link: https://github.com/macports/macports-ports/pull/19047#issuecomment-1636059809
|
|
|
|
|
|
|
| |
This fixes a storm of EMFILE retries observed with -j1 on a very large
directory tree.
Fixes: 7888fbababd22190e9f919fc272957426a27969e
|
|
|
|
|
| |
This required shuffling a lot of code around. Hopefully the new order
makes more sense.
|