X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling%2FMEDCouplingRefCountObject.cxx;h=bb788d7c48b44918564ce08d61da88c64c2f45ff;hb=b8616069f6667dcec3f90574a05bfc9e66d87fa5;hp=725c1cf19a17212cac7b6c5e2827276e4f4debef;hpb=c5f9a2bb5f775564b5bd81de58dfa708bcef020d;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling/MEDCouplingRefCountObject.cxx b/src/MEDCoupling/MEDCouplingRefCountObject.cxx index 725c1cf19..bb788d7c4 100644 --- a/src/MEDCoupling/MEDCouplingRefCountObject.cxx +++ b/src/MEDCoupling/MEDCouplingRefCountObject.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2016 CEA/DEN, EDF R&D +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -20,6 +20,7 @@ #include "MEDCouplingRefCountObject.hxx" #include "MEDCoupling_version.h" +#include "MCType.hxx" #include "InterpKernelException.hxx" @@ -53,6 +54,11 @@ int MEDCoupling::MEDCouplingSizeOfVoidStar() return 8*sizeof(std::size_t); } +std::size_t MEDCoupling::MEDCouplingSizeOfIDs() +{ + return 8*sizeof(mcIdType); +} + /*! * If true is returned it is a LittleEndian machine. * If false it is a BigEndian machine. @@ -75,8 +81,42 @@ const char *MEDCoupling::MEDCouplingByteOrderStr() return BIGENDIAN_STR; } +bool MEDCoupling::IsCXX11Compiled() +{ + return true; +} + //= +std::string BigMemoryObject::debugHeapMemorySize() const +{ + std::size_t ret(getHeapMemorySizeWithoutChildren()),sum(ret); + std::ostringstream oss; + std::vector s2(getDirectChildren()); + std::set s1; + oss << "this (" << this->getClassName() << ") -> " << ret << std::endl; + while(!s2.empty()) + { + std::vector s3; + for(auto it : s2) + { + if(s1.find(it)==s1.end()) + { + ret = it->getHeapMemorySizeWithoutChildren(); sum+=ret; + oss << it->getClassName() << " -> " << ret << std::endl; + s1.insert(it); + std::vector v2(it->getDirectChildren()); + for(auto it2 : v2) + if(s1.find(it2)==s1.end()) + s3.push_back(it2); + } + } + s2=s3; + } + oss << "sum = " << sum << std::endl; + return oss.str(); +} + std::size_t BigMemoryObject::getHeapMemorySize() const { std::size_t ret(getHeapMemorySizeWithoutChildren());