Changeset 920c70 for src/helpers.cpp
- Timestamp:
- May 31, 2010, 1:09:58 PM (16 years ago)
- Branches:
- Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, Candidate_v1.7.0, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
- Children:
- 42af9e
- Parents:
- 87b597
- File:
-
- 1 edited
-
src/helpers.cpp (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/helpers.cpp
r87b597 r920c70 58 58 int CountLinesinFile(ifstream &InputFile) 59 59 { 60 char *buffer = Malloc<char>(MAXSTRINGSIZE, "CountLinesinFile: *buffer");60 char *buffer = new char[MAXSTRINGSIZE]; 61 61 int lines=0; 62 62 … … 70 70 } 71 71 InputFile.seekg(PositionMarker, ios::beg); 72 Free(&buffer);72 delete[](buffer); 73 73 return lines; 74 74 }; … … 90 90 } 91 91 // allocate string 92 returnstring = Malloc<char>(order + 2, "FixedDigitNumber: *returnstring");92 returnstring = new char[order + 2]; 93 93 // terminate and fill string array from end backward 94 94 returnstring[order] = '\0'; … … 122 122 double * ReturnFullMatrixforSymmetric(const double * const symm) 123 123 { 124 double *matrix = Malloc<double>(NDIM * NDIM, "molecule::ReturnFullMatrixforSymmetric: *matrix");124 double *matrix = new double[NDIM * NDIM]; 125 125 matrix[0] = symm[0]; 126 126 matrix[1] = symm[1]; … … 140 140 double * InverseMatrix( const double * const A) 141 141 { 142 double *B = Malloc<double>(NDIM * NDIM, "Vector::InverseMatrix: *B");142 double *B = new double[NDIM * NDIM]; 143 143 double detA = RDET3(A); 144 144 double detAReci; … … 196 196 197 197 if (buffer != NULL) { 198 MemoryUsageObserver::getInstance()->addMemory(buffer, size);198 //MemoryUsageObserver::getInstance()->addMemory(buffer, size); 199 199 } else { 200 200 Log() << Verbose(0) << "Malloc for datatype " << typeid(char).name() … … 206 206 207 207 /** 208 * Frees all memory registered by the memory observer and calls exit(225) afterwards.208 * Calls exit(255). 209 209 */ 210 210 void performCriticalExit() { 211 // map<void*, size_t> pointers = MemoryUsageObserver::getInstance()->getPointersToAllocatedMemory();212 // for (map<void*, size_t>::iterator runner = pointers.begin(); runner != pointers.end(); runner++) {213 // Free(((void**) &runner->first));214 // }215 216 211 exit(255); 217 212 }
Note:
See TracChangeset
for help on using the changeset viewer.
