forked from lijiext/lammps
avoid small memory leak with USER-REAXC + USER-OMP, spotted by GCC's address sanitizer
This commit is contained in:
parent
69d97fa60c
commit
734729b0a4
|
@ -196,11 +196,10 @@ void DeAllocate_Workspace( control_params *control, storage *workspace )
|
||||||
|
|
||||||
/* reductions */
|
/* reductions */
|
||||||
#ifdef LMP_USER_OMP
|
#ifdef LMP_USER_OMP
|
||||||
if(workspace->CdDeltaReduction) sfree( workspace->CdDeltaReduction, "cddelta_reduce" );
|
if (workspace->CdDeltaReduction) sfree( workspace->CdDeltaReduction, "cddelta_reduce" );
|
||||||
if(workspace->forceReduction) sfree( workspace->forceReduction, "f_reduce" );
|
if (workspace->forceReduction) sfree( workspace->forceReduction, "f_reduce" );
|
||||||
if(workspace->valence_angle_atom_myoffset) sfree( workspace->valence_angle_atom_myoffset, "valence_angle_atom_myoffset");
|
if (workspace->valence_angle_atom_myoffset) sfree( workspace->valence_angle_atom_myoffset, "valence_angle_atom_myoffset");
|
||||||
|
if (workspace->my_ext_pressReduction) sfree( workspace->my_ext_pressReduction, "ext_press_reduce");
|
||||||
if (control->virial && workspace->my_ext_pressReduction) sfree( workspace->my_ext_pressReduction, "ext_press_reduce");
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -307,9 +306,7 @@ int Allocate_Workspace( reax_system *system, control_params *control,
|
||||||
"forceReduction", comm);
|
"forceReduction", comm);
|
||||||
|
|
||||||
workspace->valence_angle_atom_myoffset = (int *) scalloc(sizeof(int), total_cap, "valence_angle_atom_myoffset", comm);
|
workspace->valence_angle_atom_myoffset = (int *) scalloc(sizeof(int), total_cap, "valence_angle_atom_myoffset", comm);
|
||||||
|
workspace->my_ext_pressReduction = (rvec *) calloc(sizeof(rvec), control->nthreads);
|
||||||
if (control->virial)
|
|
||||||
workspace->my_ext_pressReduction = (rvec *) calloc(sizeof(rvec), control->nthreads);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
|
|
Loading…
Reference in New Issue