aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/serialise.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2022-08-12 12:28:02 +0200
committerEelco Dolstra <edolstra@gmail.com>2022-08-17 11:32:01 +0200
commit53e7b7e8ac44704199a868c0f6850ac53a0b8ad1 (patch)
tree3da13593f7acc9c9be7c26d24d41413fbcd75f8e /src/libutil/serialise.cc
parentc3769c68465bae971ab6bb48cfcdea85b61ea83a (diff)
Remove warnLargeDump()
This message was unhelpful (#1184) and probably misleading since memory is O(1) in most cases now.
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);
}