itaps-parallel technical issues in iMeshP.h

Jason Kraftcheck kraftche at cae.wisc.edu
Mon Oct 6 09:54:13 CDT 2008


Onkar Sahni wrote:
[snip example]
> 
>    I do not know if iMeshP_destroyPartitionAll() is completely necessary
> but above example doesn't make it clear either as I would ask why would
> one call iMeshP_destroyPartitionAll() in ~Partition() (destructor) with
> no call to iMeshP_destroyPartitionAll() in Partition() (constructor)?
> 
> class foo {
>   public:
>   foo(int *a) : acopy(a) {}
>   ~foo() { delete [] acopy; }
>   private:
>   int *acopy;
> };
> 
> int main(int argc, int *argv[]) {
>   int *a_try = new int;
>   foo foo1(a_try);
>   delete a_try;
>   return 1;
> }
> 
>   a_try is not allocated in foo() but deleted in ~foo() and its not array.
> 

hether or not you like my coding style is irrelevant to the question of
whether or not the handle passed to iMeshP_destroyPartitionAll should
"inout", unless you are claiming that it will not be a problem for any code
that you feel is "correct".

- jason

P.S. std::auto_ptr also violates your "rule".








More information about the itaps-parallel mailing list