From 3c4e34eec1fdb02ba2bb664da2ce3e395318982e Mon Sep 17 00:00:00 2001 From: apo Date: Mon, 4 Dec 2006 07:07:42 +0000 Subject: [PATCH] To implement more accurate memory size calculation --- src/CONVERTOR/VISU_Convertor_impl.cxx | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) 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; } -- 2.39.2