From: apo Date: Mon, 4 Dec 2006 07:07:42 +0000 (+0000) Subject: To implement more accurate memory size calculation X-Git-Tag: WP1_2_3_05-12-2006_cache_system~7 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3c4e34eec1fdb02ba2bb664da2ce3e395318982e;p=modules%2Fvisu.git To implement more accurate memory size calculation --- diff --git a/src/CONVERTOR/VISU_Convertor_impl.cxx b/src/CONVERTOR/VISU_Convertor_impl.cxx index 4bfe9a5b..ac3462d5 100644 --- a/src/CONVERTOR/VISU_Convertor_impl.cxx +++ b/src/CONVERTOR/VISU_Convertor_impl.cxx @@ -452,8 +452,13 @@ namespace VISU size_t aSize = TAppendFilter::GetMemorySize(); aSize += myNamedPointCoords->GetMemorySize(); aSize += myElemObj2VTKID.size() * 2 * sizeof(vtkIdType); - for(size_t anId = 0; anId < mySubProfileArr.size(); anId++) - aSize += mySubProfileArr[anId]->GetMemorySize(); + TGeom2SubProfile::const_iterator anIter = myGeom2SubProfile.begin(); + TGeom2SubProfile::const_iterator anIterEnd = myGeom2SubProfile.end(); + for(; anIter != anIterEnd; anIter++){ + const PSubProfileImpl& aSubProfile = anIter->second; + aSize += aSubProfile->GetMemorySize(); + aSize += sizeof(EGeometry); + } return aSize; } @@ -642,8 +647,13 @@ namespace VISU { size_t aSize = TAppendFilter::GetMemorySize(); aSize += mySource.GetMemorySize(); - for(size_t anId = 0; anId < myGaussSubMeshArr.size(); anId++) - aSize += myGaussSubMeshArr[anId]->GetMemorySize(); + TGeom2GaussSubMesh::const_iterator anIter = myGeom2GaussSubMesh.begin(); + TGeom2GaussSubMesh::const_iterator anIterEnd = myGeom2GaussSubMesh.end(); + for(; anIter != anIterEnd; anIter++){ + const PGaussSubMeshImpl& aGaussSubMesh = anIter->second; + aSize += aGaussSubMesh->GetMemorySize(); + aSize += sizeof(EGeometry); + } return aSize; } @@ -764,9 +774,12 @@ namespace VISU size_t aSize = TAppendFilter::GetMemorySize(); aSize += myNamedPointCoords->GetMemorySize(); aSize += myElemObj2VTKID.size() * 2 * sizeof(vtkIdType); - for(size_t anId = 0; anId < mySubMeshArr.size(); anId++){ - const PSubMeshImpl& aSubMesh = mySubMeshArr[anId]; + TGeom2SubMesh::const_iterator anIter = myGeom2SubMesh.begin(); + TGeom2SubMesh::const_iterator anIterEnd = myGeom2SubMesh.end(); + for(; anIter != anIterEnd; anIter++){ + const PSubMeshImpl& aSubMesh = anIter->second; aSize += aSubMesh->GetMemorySize(); + aSize += sizeof(EGeometry); } return aSize; }