summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDennis Francis <dennis.francis@collabora.com>2019-12-04 15:29:06 +0530
committerDennis Francis <dennis.francis@collabora.com>2020-01-04 07:58:06 +0100
commit0b8ae8725083eb0526a262d434cc06fb3f3e7336 (patch)
treefe628f0a7537533ca9b99b255a0bbf07e229af5b /include
parentdd198398b6e5c84ab1255a90ef96e6445b66a64f (diff)
tdf#125662: disable parallel-zip if the memory...
required to carry it out will cause a breach of addressable memory limit. This can happen in 32bit OSes, where the physical memory limit is more than the process addressable memory limit. For example in Win32, a process can address only upto 2GB. More specifically, avoid using ZipOutputEntryParallel which rougly needs twice the memory compared to its counterparts. Change-Id: I4d1abbf75e928188bcf806fcf1e5872b1e51b502 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/84394 Tested-by: Jenkins Reviewed-by: Dennis Francis <dennis.francis@collabora.com>
Diffstat (limited to 'include')
-rw-r--r--include/comphelper/meminfo.hxx37
1 files changed, 37 insertions, 0 deletions
diff --git a/include/comphelper/meminfo.hxx b/include/comphelper/meminfo.hxx
new file mode 100644
index 000000000000..795d7a45bba9
--- /dev/null
+++ b/include/comphelper/meminfo.hxx
@@ -0,0 +1,37 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_COMPHELPER_MEMINFO_HXX
+#define INCLUDED_COMPHELPER_MEMINFO_HXX
+
+#include <comphelper/comphelperdllapi.h>
+
+namespace comphelper
+{
+/**
+ * canAlloc() checks whether allocSize bytes can be allocated without exceeding
+ * addressable memory limit. This is useful in case of 32-bit systems where
+ * process addressable memory limit is less than physical memory limit.
+ */
+COMPHELPER_DLLPUBLIC bool canAlloc(sal_Int64 allocSize);
+}
+
+#endif // INCLUDED_COMPHELPER_MEMINFO_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */