aboutsummaryrefslogtreecommitdiffstats
path: root/include/qpdf/QUtil.hh
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-08-31 18:49:29 +0200
committerJay Berkenbilt <ejb@ql.org>2022-08-31 20:47:27 +0200
commit0a54247652e49ce384dcf0d8df078201aa106089 (patch)
treed1609cab26a6b66c33dfb88dd43811894ec219dc /include/qpdf/QUtil.hh
parent0adfd74f8b5dc96091cd0b4251b08401f54df2ed (diff)
downloadqpdf-0a54247652e49ce384dcf0d8df078201aa106089.tar.zst
Add QUtil::get_max_memory_usage for testing
Diffstat (limited to 'include/qpdf/QUtil.hh')
-rw-r--r--include/qpdf/QUtil.hh12
1 files changed, 11 insertions, 1 deletions
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)