memorymanagment.h 947 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //#pragma once
  2. /*
  3. * Author: David Robert Nadeau
  4. * Site: http://NadeauSoftware.com/
  5. * License: Creative Commons Attribution 3.0 Unported License
  6. * http://creativecommons.org/licenses/by/3.0/deed.en_US
  7. */
  8. #if defined(_WIN32)
  9. #include <windows.h>
  10. #include <psapi.h>
  11. #elif defined(__unix__) || defined(__unix) || defined(unix) || (defined(__APPLE__) && defined(__MACH__))
  12. #include <unistd.h>
  13. #include <sys/resource.h>
  14. #if defined(__APPLE__) && defined(__MACH__)
  15. #include <mach/mach.h>
  16. #elif (defined(_AIX) || defined(__TOS__AIX__)) || (defined(__sun__) || defined(__sun) || defined(sun) && (defined(__SVR4) || defined(__svr4__)))
  17. #include <fcntl.h>
  18. #include <procfs.h>
  19. #elif defined(__linux__) || defined(__linux) || defined(linux) || defined(__gnu_linux__)
  20. #include <stdio.h>
  21. #endif
  22. #else
  23. #error "Cannot define getPeakRSS( ) or getCurrentRSS( ) for an unknown OS."
  24. #endif
  25. size_t getPeakRSS( );
  26. size_t getCurrentRSS( );