Barry Smith <[email protected]> writes: > I propose the following alternative: > > Remove the type arguments from PetscMalloc2-7()
I'm happy to do this. I think I can almost entirely automate it.
I agree that these functions are almost exclusively used internally, and
I think that every use in PETSc matches the types, so there is no point
keeping the old versions.
> Add PetscMalloc1()
>
> Add PetscCalloc1()
>
> Use PetscCalloc1() to implement PetscNew()
PetscCalloc1 *is* PetscNew. I would prefer "calloc" since it matches a
libc function that does the same thing, where as "new" conjures up
images of C++, where "new" only initializes non-POD types (which
includes std::complex<double>, but not struct {double real,imag;}). So
perhaps replace all uses of PetscNew with PetscCalloc1?
I wonder how many uses of PetscNew should have actually been PetscNewLog.
pgpHVSSLWrtvs.pgp
Description: PGP signature
