]> OCCT Git - occt-copy.git/commitdiff
Revert "0030901: Visualization - OSD_MemInfo moving memory computation out of the...
authornds <nds@opencascade.com>
Thu, 15 Aug 2019 08:47:36 +0000 (11:47 +0300)
committernds <nds@opencascade.com>
Thu, 15 Aug 2019 08:48:32 +0000 (11:48 +0300)
src/Draw/Draw_BasicCommands.cxx
src/OSD/OSD_MemInfo.cxx
src/OSD/OSD_MemInfo.hxx
src/QABugs/QABugs_20.cxx

index a5d1f332ddab35c339d0d1d99858ca89ee64f883..638fcfdd9d01879b95ec5e8552b0bce609339564 100644 (file)
@@ -763,7 +763,6 @@ static int dmeminfo (Draw_Interpretor& theDI,
                      const char**      theArgVec)
 {
   OSD_MemInfo aMemInfo;
-  aMemInfo.Update();
   if (theArgNb <= 1)
   {
     theDI << aMemInfo.ToString();
index 04c883a2c7e65c9b04cea7a9b73c943ba6a6811b..d5eda9ee262b9afea1952a331059e51c422fb252 100644 (file)
 // =======================================================================
 OSD_MemInfo::OSD_MemInfo()
 {
-  // reset values
-  for (Standard_Integer anIter = 0; anIter < MemCounter_NB; ++anIter)
-  {
-    myCounters[anIter] = Standard_Size(-1);
-  }
+  Update();
 }
 
 // =======================================================================
@@ -231,14 +227,14 @@ Standard_Size OSD_MemInfo::Value (const OSD_MemInfo::Counter theCounter) const
 // function : ValueMiB
 // purpose  :
 // =======================================================================
-Standard_Real OSD_MemInfo::ValueMiB (const OSD_MemInfo::Counter theCounter) const
+Standard_Size OSD_MemInfo::ValueMiB (const OSD_MemInfo::Counter theCounter) const
 {
   if (theCounter < 0 || theCounter >= MemCounter_NB)
   {
-    return Standard_Real(-1.);
+    return Standard_Size(-1);
   }
   return (myCounters[theCounter] == Standard_Size(-1))
-       ? Standard_Real(-1.) : ((Standard_Real)myCounters[theCounter] / (1024 * 1024));
+       ? Standard_Size(-1) : (myCounters[theCounter] / (1024 * 1024));
 }
 
 // =======================================================================
index 40633e00f66c3c39b8e4ffd58495b8d21edd7740..e1def2dc3dad5499684f74978fc09332c1db1769 100644 (file)
@@ -82,7 +82,7 @@ public:
   //! Return value or specified counter in MiB.
   //! Notice that NOT all counters are available on various systems.
   //! Standard_Size(-1) means invalid (unavailable) value.
-  Standard_EXPORT Standard_Real ValueMiB (const OSD_MemInfo::Counter theCounter) const;
+  Standard_EXPORT Standard_Size ValueMiB (const OSD_MemInfo::Counter theCounter) const;
 
 public:
 
index 93a04ae4fe39df5f48a6633cf118aaaa7372ac7b..7b676e5e8482194f4b0eed43fc9e22abb891f4ea 100644 (file)
@@ -2786,7 +2786,6 @@ template<typename T> void AllocDummyArr (Draw_Interpretor& theDI, int theN1, int
   NCollection_Array1<T> aMapArr1(0, theN1), aMapArr2(0, theN2);
 
   OSD_MemInfo aMemTool;
-  aMemTool.Update();
   Standard_Size aMem0 = aMemTool.Value (OSD_MemInfo::MemHeapUsage);
 
   for (int i = 1; i < theN1; i++)