create/destroy name change proposal

Tim Tautges tautges at mcs.anl.gov
Thu May 6 12:33:22 CDT 2010



Mark Miller wrote:
> On Thu, 2010-05-06 at 08:51, Tim Tautges wrote:
> 
> iMesh_newMesh --> iMesh_createMesh
> iMesh_dtor --> iMesh_destroyMesh
> 
> Yes, thats better than iMesh_new and iMesh_destroy. I agree.
> 
>> - I think we should allow apps to specialize on memory management, and the current API allows that well enough now
>>
> 
> What about iMesh_destroyMesh? Like Mark B., I think that SHOULD free
> memory because it is destroying the whole of the iMesh instance and
> there is no valid argument I think for having some objects within it
> left around.
> 
> So, I think that caller's should be made aware of the fact that if they
> expect an iMesh_destroyXXX (or even iMesh_removeXXX) to free memory,
> that the iMesh specification makes no guarantees regarding free'ing of
> memory. I think that is a common expectation for user's calling a
> destroy (and maybe even a remove) function to have and I think they
> should be forewarned that such expectation is not valid.

This depends on the implementation, and in particular whether the iMesh_createMesh creates a new instance of the 
underlying mesh storage library, or whether it just instantiates the interface on top of an existing database.  In most 
cases I'd expect it to be the former, and in that case, I'd also expect the storage to go away when the destroy function 
was called.

- tim

> 
> Mark
> 

-- 
================================================================
"You will keep in perfect peace him whose mind is
   steadfast, because he trusts in you."               Isaiah 26:3

              Tim Tautges            Argonne National Laboratory
          (tautges at mcs.anl.gov)      (telecommuting from UW-Madison)
          phone: (608) 263-8485      1500 Engineering Dr.
            fax: (608) 263-4499      Madison, WI 53706



More information about the tstt-interface mailing list