aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/serialise.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2022-08-22 15:29:10 +0200
committerEelco Dolstra <edolstra@gmail.com>2022-08-22 15:29:10 +0200
commit4c96761c2bb51cb1635b7bbe56784daeeeee1561 (patch)
tree5713add9413b3499cc7f587f93c16029ffb87fed /src/libutil/serialise.cc
parent7ed91d6c6ab86199e7c9703f2852f47d36976d6b (diff)
parent7c3ab5751568a0bc63430b33a5169c5e4784a0ff (diff)
Merge remote-tracking branch 'origin/master' into parallel-nix-copy
Diffstat (limited to 'src/libutil/serialise.cc')
-rw-r--r--src/libutil/serialise.cc20
1 files changed, 0 insertions, 20 deletions
diff --git a/src/libutil/serialise.cc b/src/libutil/serialise.cc
index 8ff904583..2c3597775 100644
--- a/src/libutil/serialise.cc
+++ b/src/libutil/serialise.cc
@@ -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);
}