Browse Source

r.terraflow: remove print "Free Memory" to stats file (#1306)

nilason 4 years ago
parent
commit
9daba65a91
2 changed files with 0 additions and 40 deletions
  1. 0 37
      raster/r.terraflow/stats.cpp
  2. 0 3
      raster/r.terraflow/stats.h

+ 0 - 37
raster/r.terraflow/stats.cpp

@@ -126,45 +126,8 @@ statsRecorder::statsRecorder(char *fname) : ofstream(noclobberFileName(fname)){
   //ofstream that takes an fd; wrote another noclobber() function that
   //closes fd and returns the name;
   rt_start(tm);
-#ifndef __MINGW32__
-  bss = sbrk(0);
-#endif
-  char buf[BUFSIZ];
-  *this << freeMem(buf) << endl;
-}
-
-/* ********************************************************************** */
-
-long 
-statsRecorder::freeMem() {
-#ifdef __MINGW32__
-  return -1;
-#else
-  struct rlimit rlim;
-  if (getrlimit(RLIMIT_DATA, &rlim) == -1) {
-	perror("getrlimit: ");
-	return -1;
-  } 	
-  /* printf("getrlimit returns: %d \n", rlim.rlim_cur); */
-  if (rlim.rlim_cur == RLIM_INFINITY) {
-	/* printf("rlim is infinity\n"); */
-	/* should fix this */
-	return -1; 
-  } 
-  long freeMem = rlim.rlim_cur - ((char*)sbrk(0)-(char*)bss);
-  return freeMem;
-#endif /* __MINGW32__ */
 }
 
-char *
-statsRecorder::freeMem(char *buf) {
-  char buf2[BUFSIZ];
-  sprintf(buf, "Free Memory=%s", formatNumber(buf2, freeMem()));
-  return buf;
-}
-
-
-
 /* ********************************************************************** */
 
 char *

+ 0 - 3
raster/r.terraflow/stats.h

@@ -35,14 +35,11 @@ int noclobberFile(char *);
 class statsRecorder : public ofstream {
 private:
   Rtimer tm;
-  void *bss;
 public:
   statsRecorder(char *fname);
   ~statsRecorder() { 
 	this->flush(); 
   }
-  char *freeMem(char *);
-  long freeMem();
   char *timestamp();
   void timestamp(const char *s);
   void comment(const char *s, const int verbose=1);