Changeset 52baaa4 in tol


Ignore:
Timestamp:
May 31, 2010, 11:33:23 AM (16 years ago)
Author:
Jorge Pérez <josp.jorge@…>
Branches:
1941-docker-image-to-test, devel, master
Children:
df92a87
Parents:
633c9d1
Message:

writing portable version of BSys::SessionAvailMem

git-svn-id: ​https://www.tol-project.org/svn/tolp/trunk@2205 be4846ae-f051-483a-831f-b64e7d08527f

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tol/bbasic/sys.cpp

    r633c9d1 r52baaa4  
    3131#ifdef UNIX
    3232#  include <errno.h>
     33#  include <sys/resource.h>
    3334#else // WINDOWS
    3435#  include <windows.h>
    … …  
    167168//--------------------------------------------------------------------
    168169{
     170#if defined(WIN32)
    169171  MEMORYSTATUSEX statex;
    170172  statex.dwLength = sizeof (statex);
    171173  GlobalMemoryStatusEx (&statex);
    172174  return((double)statex.ullAvailVirtual);
     175#else
     176  int who = RUSAGE_SELF;
     177  struct rusage usage;
     178  int ret;
     179
     180  ret=getrusage(who,&usage);
     181
     182  return usage.ru_maxrss;
     183#endif
    173184};
    174185
Note: See TracChangeset for help on using the changeset viewer.