Commit af580280 authored by PIACIBELLO Cyrille's avatar PIACIBELLO Cyrille

Debug on free_leaf method for the C API + memory leaks

parent 7df6087c
......@@ -199,6 +199,9 @@ public:
arrayOfUserContainer[idx] = neighbors[idx]->getContainer();
}
kernel.p2p_full(targets->getContainer(),targets->getNbParticles(),targets->getIndexes().data(),arrayOfUserContainer,indicesPerNeighbors,nbPartPerNeighbors,sourcePosition,size,userData);
delete [] nbPartPerNeighbors;
delete [] indicesPerNeighbors;
delete [] arrayOfUserContainer;
}
if(kernel.p2p_sym){
for(int idx = 0 ; ((idx < size) && (sourcePosition[idx] < 14)) ; ++idx){
......@@ -515,7 +518,7 @@ public:
void free_cell(Callback_free_cell user_cell_deallocator, Callback_free_leaf free_leaf){
octree->forEachCellLeaf([&](CoreCell * currCell, LeafClass * leaf){
free_leaf(currCell->getContainer(),leaf->getSrc()->getNbParticles(), leaf->getSrc()->getIndexes().data(),leaf,this->kernel);
free_leaf(currCell->getContainer(),leaf->getSrc()->getNbParticles(), leaf->getSrc()->getIndexes().data(),leaf->getSrc()->getContainer(),this->kernel);
});
octree->forEachCell([&](CoreCell * currCell){
if(currCell->getContainer()){
......
......@@ -34,15 +34,17 @@ void cheb_free_cell(void * inCell){
* No need for leaf function
*/
void * cheb_init_leaf(int level, FSize nbParts, const FSize * idxParts, long long morton_index, double center[3],
void * cellDatas, void * userDatas){
void * cellDatas, void * userDatas){
//Do nothing
return NULL;
int * A = malloc(sizeof(double) * nbParts);
return A;
}
/**
* No need for leaf function
*/
void cheb_free_leaf(void * cellDatas, FSize nbParts, const FSize * idxParts, void * leafData, void * userDatas){
free(leafData);
//Do nothing
}
......
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