Rationale for simple_capsule_dtor to be static but non-inline ?

Hi, in npy3_compat.h, one function simple_capsule_dtor is defined as static but non-inline. AFAIK, there is no reason not to put inline (if supported by the compiler of course) for a static function defined in a header. Unless I hear someone justify it, I will change it, cheers, David

On Wed, Feb 9, 2011 at 10:50 PM, David <david@silveregg.co.jp> wrote:
Hi,
in npy3_compat.h, one function simple_capsule_dtor is defined as static but non-inline. AFAIK, there is no reason not to put inline (if supported by the compiler of course) for a static function defined in a header. Unless I hear someone justify it, I will change it,
It's only used as an argument so it needs to be defined, there is no place that it can be inlined. The NpyCapsule stuff could probably be moved out of the header into a compatibility library somewhere but that would require the builds of numpy/scipy to all link with that library. Chuck

On Thu, Feb 10, 2011 at 4:26 AM, Charles R Harris <charlesr.harris@gmail.com
wrote:
On Wed, Feb 9, 2011 at 10:50 PM, David <david@silveregg.co.jp> wrote:
Hi,
in npy3_compat.h, one function simple_capsule_dtor is defined as static but non-inline. AFAIK, there is no reason not to put inline (if supported by the compiler of course) for a static function defined in a header. Unless I hear someone justify it, I will change it,
It's only used as an argument so it needs to be defined, there is no place that it can be inlined. The NpyCapsule stuff could probably be moved out of the header into a compatibility library somewhere but that would require the builds of numpy/scipy to all link with that library.
That said, inline should work also, but one needs a bit more faith in the compiler... Chuck
participants (2)
-
Charles R Harris
-
David