Commit 7b5159b1 by Chloe Dequeker

malloc optimisation

parent 192b4988
...@@ -543,6 +543,7 @@ int main(int argc, char** argv){ ...@@ -543,6 +543,7 @@ int main(int argc, char** argv){
writePDB(newPDB, ligand,target_conf); writePDB(newPDB, ligand,target_conf);
} }
freePDB(newPDB); freePDB(newPDB);
newPDB = NULL;
}else if(complexPDB){ /* If we are building for a given complex, no rotation */ }else if(complexPDB){ /* If we are building for a given complex, no rotation */
/* Write the number of the conformation and get the interface */ /* Write the number of the conformation and get the interface */
...@@ -570,9 +571,9 @@ int main(int argc, char** argv){ ...@@ -570,9 +571,9 @@ int main(int argc, char** argv){
/* This is the rotated PDB /* This is the rotated PDB
* pdbL doesn't change throughout the program * pdbL doesn't change throughout the program
*/ */
newPDB = rotate_sophie(pdbL,pdbR,NULL,dock_res->distCenters[i], newPDB = rotate_sophie(pdbL, pdbR, newPDB, dock_res->distCenters[i],
dock_res->theta[i],dock_res->phi[i], dock_res->theta[i], dock_res->phi[i],
dalpha,dbeta,dgamma,dock_res,i); dalpha, dbeta, dgamma, dock_res, i);
/* Write the number of the conformation and get the interface */ /* Write the number of the conformation and get the interface */
fprintf(outputFile_lig,"%d ",i); fprintf(outputFile_lig,"%d ",i);
...@@ -584,8 +585,9 @@ int main(int argc, char** argv){ ...@@ -584,8 +585,9 @@ int main(int argc, char** argv){
if(constructPDB){ if(constructPDB){
writePDB(newPDB, ligand,i); writePDB(newPDB, ligand,i);
} }
freePDB(newPDB);
} }
freePDB(newPDB);
newPDB = NULL;
} }
freePDB(pdbL); freePDB(pdbL);
......
...@@ -6,7 +6,9 @@ ...@@ -6,7 +6,9 @@
void freePDB(struct pdb_values* pdb){ void freePDB(struct pdb_values* pdb){
free(pdb->residues); free(pdb->residues);
free(pdb); free(pdb);
pdb = NULL; pdb = NULL; /* Has not effect since the adress passed as argument
* won't change
*/
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment