| Index: tools/ProcStats.h
|
| diff --git a/tools/ProcStats.h b/tools/ProcStats.h
|
| index 14b98b7a28c2c187df1d316bf7b628e0286ebdd4..f085fe31a6ff532044928b32a04e567a1be6a5a8 100644
|
| --- a/tools/ProcStats.h
|
| +++ b/tools/ProcStats.h
|
| @@ -15,11 +15,27 @@
|
| namespace sk_tools {
|
|
|
| /**
|
| - * If not implemented for this OS, returns -1. Otherwise, return
|
| - * the maximum resident set size, as reported by getrusage().
|
| + * If implemented, returns the maximum resident set size in MB.
|
| + * If not, returns -1.
|
| */
|
| int getMaxResidentSetSizeMB();
|
|
|
| +/**
|
| + * If implemented, returns the current resident set size in MB.
|
| + * If not, returns -1.
|
| + */
|
| +int getCurrResidentSetSizeMB();
|
| +
|
| +/**
|
| + * If implemented, returns getCurrResidentSetSizeMB().
|
| + * If not, if implemented, returns getMaxResidentSetSizeMB().
|
| + * If not, returns -1.
|
| + */
|
| +inline int getBestResidentSetSizeMB() {
|
| + int mb = getCurrResidentSetSizeMB();
|
| + return mb >= 0 ? mb : getMaxResidentSetSizeMB();
|
| +}
|
| +
|
| } // namespace sk_tools
|
|
|
| #endif // ProcStats_DEFINED
|
|
|