mirror of
https://github.com/NixOS/nix
synced 2025-06-27 08:31:16 +02:00
Remove warnLargeDump()
This message was unhelpful (#1184) and probably misleading since memory is O(1) in most cases now.
This commit is contained in:
parent
c3769c6846
commit
53e7b7e8ac
3 changed files with 1 additions and 25 deletions
|
@ -48,24 +48,9 @@ FdSink::~FdSink()
|
|||
}
|
||||
|
||||
|
||||
size_t threshold = 256 * 1024 * 1024;
|
||||
|
||||
static void warnLargeDump()
|
||||
{
|
||||
warn("dumping very large path (> 256 MiB); this may run out of memory");
|
||||
}
|
||||
|
||||
|
||||
void FdSink::write(std::string_view data)
|
||||
{
|
||||
written += data.size();
|
||||
static bool warned = false;
|
||||
if (warn && !warned) {
|
||||
if (written > threshold) {
|
||||
warnLargeDump();
|
||||
warned = true;
|
||||
}
|
||||
}
|
||||
try {
|
||||
writeFull(fd, data);
|
||||
} catch (SysError & e) {
|
||||
|
@ -448,11 +433,6 @@ Error readError(Source & source)
|
|||
|
||||
void StringSink::operator () (std::string_view data)
|
||||
{
|
||||
static bool warned = false;
|
||||
if (!warned && s.size() > threshold) {
|
||||
warnLargeDump();
|
||||
warned = true;
|
||||
}
|
||||
s.append(data);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue