Commit 3492328c authored by PIACIBELLO Cyrille's avatar PIACIBELLO Cyrille

Last changes inside API, in order to be able to free arrays of FSIze too

parent 6ee28dd9
......@@ -891,9 +891,12 @@ void scalfmm_generic_partition(scalfmm_handle handle, FSize nbThings, size_t siz
/**
* @brief This fct will call delete on its arg, in order to free the
* memory allocated inside scalfmm, but given back to the user.
* memory allocated inside scalfmm, but given back to the user. Both
* the args are tested, so user can call delete(NULL,array);
* @param array : array of double to be deleted
* @param arrayOfFSize : array of FSize to be deleted
*/
void scalfmm_call_delete(void * array);
void scalfmm_call_delete(double * array, FSize * arrayOfFSize);
#endif //MPI_VERSION
......
......@@ -1073,8 +1073,11 @@ extern "C" void scalfmm_generic_partition(scalfmm_handle handle, FSize nbThings,
((ScalFmmCoreHandle<double> * ) handle)->engine->generic_partition(nbThings,sizeofthing,arrayOfThing,newArray);
}
extern "C" void scalfmm_call_delete(void * inPtr){
delete [] static_cast<double*>(inPtr);
extern "C" void scalfmm_call_delete(double * inDoublePtr,FSize * inFSizePtr){
if(inDoublePtr)
delete [] inDoublePtr;
if(inFSizePtr)
delete [] inFSizePtr;
}
#endif
......
......@@ -394,9 +394,8 @@ int main(int argc, char ** argv){
/* } */
}
scalfmm_call_delete(outputIndexes);
scalfmm_call_delete(outputArray);
scalfmm_call_delete(*outputPhyValPtr);
scalfmm_call_delete(outputArray,outputIndexes);
scalfmm_call_delete(*outputPhyValPtr,NULL);
MPI_Finalize();
......
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