[petsc-dev] f2ea636de175: switched VecGetArray2/3 etc to be macros instead of functions

Barry Smith bsmith at mcs.anl.gov
Thu Jun 10 09:30:52 CDT 2010


   Jed,

    Currently VecGetArray() is a macro, so these just follow that style.

    In the general move to make everything static inline functions instead of macros we can change them. But I don't see the hurry to do it today.

   Barry

On Jun 10, 2010, at 7:06 AM, Jed Brown wrote:

> changeset:   16141:f2ea636de175
> user:        Victor Minden victorminden at gmail.com
> date:        Wed Jun 09 13:26:45 2010 -0500
> files:       include/private/vecimpl.h src/vec/vec/impls/dvecimpl.h src/vec/vec/impls/seq/dvec2.c
> description:
> switched VecGetArray2/3 etc to be macros instead of functions
> 
> 
> Why?  I think these should still be functions, the generated code (with
> optimization) is identical with static inline, but type checking and
> error messages are better.  If you want genericity in array type, you
> can make that argument void* as with DAVecGetArray().  In any case, I
> don't agree with calling CHKERRQ() within a macro, and the macro body
> needs to be protected.  (I know these are currently private, but I think
> they are useful enough to make public.)
> 
> Jed




More information about the petsc-dev mailing list