Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
021236b2
Commit
021236b2
authored
Aug 03, 2009
by
Peter Eastman
Browse files
Fixed some memory errors found by Valgrind
parent
d099819a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
platforms/reference/src/gbsa/CpuGBVI.cpp
platforms/reference/src/gbsa/CpuGBVI.cpp
+5
-2
platforms/reference/src/gbsa/GBVIParameters.cpp
platforms/reference/src/gbsa/GBVIParameters.cpp
+1
-1
No files found.
platforms/reference/src/gbsa/CpuGBVI.cpp
View file @
021236b2
...
@@ -566,8 +566,8 @@ int CpuGBVI::computeBornForces( const RealOpenMM* bornRadii, RealOpenMM** atomCo
...
@@ -566,8 +566,8 @@ int CpuGBVI::computeBornForces( const RealOpenMM* bornRadii, RealOpenMM** atomCo
const
unsigned
int
arraySzInBytes
=
sizeof
(
RealOpenMM
)
*
numberOfAtoms
;
const
unsigned
int
arraySzInBytes
=
sizeof
(
RealOpenMM
)
*
numberOfAtoms
;
RealOpenMM
**
forces
=
(
RealOpenMM
**
)
malloc
(
sizeof
(
RealOpenMM
*
)
*
numberOfAtoms
)
;
RealOpenMM
**
forces
=
new
RealOpenMM
*
[
numberOfAtoms
]
;
RealOpenMM
*
block
=
(
RealOpenMM
*
)
malloc
(
sizeof
(
RealOpenMM
)
*
numberOfAtoms
*
3
)
;
RealOpenMM
*
block
=
new
RealOpenMM
[
numberOfAtoms
*
3
]
;
memset
(
block
,
0
,
sizeof
(
RealOpenMM
)
*
numberOfAtoms
*
3
);
memset
(
block
,
0
,
sizeof
(
RealOpenMM
)
*
numberOfAtoms
*
3
);
RealOpenMM
*
blockPtr
=
block
;
RealOpenMM
*
blockPtr
=
block
;
for
(
int
ii
=
0
;
ii
<
numberOfAtoms
;
ii
++
){
for
(
int
ii
=
0
;
ii
<
numberOfAtoms
;
ii
++
){
...
@@ -783,6 +783,9 @@ if( 0 ){
...
@@ -783,6 +783,9 @@ if( 0 ){
inputForces
[
atomI
][
2
]
=
conversion
*
forces
[
atomI
][
2
];
inputForces
[
atomI
][
2
]
=
conversion
*
forces
[
atomI
][
2
];
}
}
delete
[]
forces
;
delete
[]
block
;
return
SimTKOpenMMCommon
::
DefaultReturn
;
return
SimTKOpenMMCommon
::
DefaultReturn
;
}
}
...
...
platforms/reference/src/gbsa/GBVIParameters.cpp
View file @
021236b2
...
@@ -148,7 +148,7 @@ GBVIParameters::~GBVIParameters( ){
...
@@ -148,7 +148,7 @@ GBVIParameters::~GBVIParameters( ){
if
(
_ownScaledRadii
){
if
(
_ownScaledRadii
){
delete
[]
_scaledRadii
;
delete
[]
_scaledRadii
;
}
}
delete
_gammaParameters
;
delete
[]
_gammaParameters
;
/*
/*
if( getFreeArrays() ){
if( getFreeArrays() ){
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment