aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJay Berkenbilt <jberkenbilt@users.noreply.github.com>2022-08-31 21:50:17 +0200
committerGitHub <noreply@github.com>2022-08-31 21:50:17 +0200
commita078202c1b5823f1c13a4c559619158054029e73 (patch)
treefd47549657238cc532768dd19b1eb9fffb5b0269 /include
parent7b3134ef94db6ae1ca17c6d2dd4843322b7546c5 (diff)
parent4aac7c325acbf80ed4a6fc121c5a36f2d5515ff1 (diff)
downloadqpdf-a078202c1b5823f1c13a4c559619158054029e73.tar.zst
Merge pull request #752 from jberkenbilt/report-mem-usage
Report mem usage
Diffstat (limited to 'include')
-rw-r--r--include/qpdf/QPDFJob.hh1
-rw-r--r--include/qpdf/QUtil.hh12
-rw-r--r--include/qpdf/auto_job_c_main.hh1
3 files changed, 13 insertions, 1 deletions
diff --git a/include/qpdf/QPDFJob.hh b/include/qpdf/QPDFJob.hh
index 0e4d8a2e..2d4ab0d2 100644
--- a/include/qpdf/QPDFJob.hh
+++ b/include/qpdf/QPDFJob.hh
@@ -711,6 +711,7 @@ class QPDFJob
bool json_input;
bool json_output;
std::string update_from_json;
+ bool report_mem_usage;
};
std::shared_ptr<Members> m;
};
diff --git a/include/qpdf/QUtil.hh b/include/qpdf/QUtil.hh
index 41b89da4..96f4f7ed 100644
--- a/include/qpdf/QUtil.hh
+++ b/include/qpdf/QUtil.hh
@@ -525,7 +525,17 @@ namespace QUtil
wchar_t const* const argv[],
std::function<int(int, char const* const[])> realmain);
#endif // QPDF_NO_WCHAR_T
-}; // namespace QUtil
+
+ // Try to return the maximum amount of memory allocated by the
+ // current process and its threads. Return 0 if unable to
+ // determine. This is Linux-specific and not implemented to be
+ // completely reliable. It is used during development for
+ // performance testing to detect changes that may significantly
+ // change memory usage. It is not recommended for use for other
+ // purposes.
+ QPDF_DLL
+ size_t get_max_memory_usage();
+}; // namespace QUtil
inline bool
QUtil::is_hex_digit(char ch)
diff --git a/include/qpdf/auto_job_c_main.hh b/include/qpdf/auto_job_c_main.hh
index 90927ded..cc655c23 100644
--- a/include/qpdf/auto_job_c_main.hh
+++ b/include/qpdf/auto_job_c_main.hh
@@ -33,6 +33,7 @@ QPDF_DLL Config* qdf();
QPDF_DLL Config* rawStreamData();
QPDF_DLL Config* recompressFlate();
QPDF_DLL Config* removePageLabels();
+QPDF_DLL Config* reportMemUsage();
QPDF_DLL Config* requiresPassword();
QPDF_DLL Config* showEncryption();
QPDF_DLL Config* showEncryptionKey();