File indexing completed on 2024-05-12 05:26:23
0001 /* 0002 * Author: David Robert Nadeau 0003 * Site: http://NadeauSoftware.com/ 0004 * License: Creative Commons Attribution 3.0 Unported License 0005 * http://creativecommons.org/licenses/by/3.0/deed.en_US 0006 * 0007 * This file has been adapted to match the coding style of the rest of the codebase. 0008 * 0009 * On windows link against psapi.lib, for the rest the standard library is sufficient. 0010 */ 0011 0012 #pragma once 0013 #include "sinktest_export.h" 0014 0015 #if defined(_WIN32) 0016 #include <windows.h> 0017 #include <psapi.h> 0018 0019 #elif defined(__unix__) || defined(__unix) || defined(unix) || (defined(__APPLE__) && defined(__MACH__)) 0020 #include <unistd.h> 0021 #include <sys/resource.h> 0022 0023 #if defined(__APPLE__) && defined(__MACH__) 0024 #include <mach/mach.h> 0025 0026 #elif(defined(_AIX) || defined(__TOS__AIX__)) || (defined(__sun__) || defined(__sun) || defined(sun) && (defined(__SVR4) || defined(__svr4__))) 0027 #include <fcntl.h> 0028 #include <procfs.h> 0029 0030 #elif defined(__linux__) || defined(__linux) || defined(linux) || defined(__gnu_linux__) 0031 #include <stdio.h> 0032 0033 #endif 0034 0035 #else 0036 #error "Cannot define getPeakRSS( ) or getCurrentRSS( ) for an unknown OS." 0037 #endif 0038 0039 size_t SINKTEST_EXPORT getCurrentRSS(); 0040 size_t SINKTEST_EXPORT getPeakRSS();