diff --git a/stim/envi/binary.h b/stim/envi/binary.h index 399b418..2af925f 100644 --- a/stim/envi/binary.h +++ b/stim/envi/binary.h @@ -7,9 +7,12 @@ #include "../math/vector.h" #include #include +#include #ifdef _WIN32 #include +#else +#include #endif namespace stim{ @@ -38,7 +41,7 @@ protected: /// Private initialization function used to set default parameters in the data structure. void init(){ - memset(R, 0, sizeof(unsigned long long) * D); //initialize the resolution to zero + std::memset(R, 0, sizeof(unsigned long long) * D); //initialize the resolution to zero header = 0; //initialize the header size to zero mask = NULL; @@ -131,6 +134,10 @@ public: statex.dwLength = sizeof (statex); GlobalMemoryStatusEx (&statex); buffer_size = (size_t)(statex.ullAvailPhys * mem_frac); +#else + size_t pages = sysconf(_SC_PHYS_PAGES); + size_t page_size = sysconf(_SC_PAGE_SIZE); + buffer_size = (size_t)(pages * page_size * mem_frac); #endif } -- libgit2 0.21.4