can cimport'ed functions be inlined?

16 views
Skip to first unread message

Nathann Cohen

unread,
Apr 20, 2015, 4:54:58 AM4/20/15
to cython...@googlegroups.com
Hello everybody,

I just wondered if some cdef function with an 'inline' flag can actually be inlined if I cimport it from another module. Or is the first moduled compiled independently and called as a library?

THaaaaaaaaanks,

Nathann

Stefan Behnel

unread,
Apr 20, 2015, 4:58:12 AM4/20/15
to cython...@googlegroups.com
Nathann Cohen schrieb am 20.04.2015 um 10:54:
> I just wondered if some cdef function with an 'inline' flag can actually be
> inlined if I cimport it from another module. Or is the first moduled
> compiled independently and called as a library?

If they live in a .pyx file (i.e. in a module), then you get inlining
inside of that module and normal C calls from other modules. If they live
in a .pxd file, then you get inlining in all modules that cimport that .pxd
file.

Stefan

Nathann Cohen

unread,
Apr 20, 2015, 4:59:23 AM4/20/15
to cython...@googlegroups.com
> If they live in a .pyx file (i.e. in a module), then you get inlining
> inside of that module and normal C calls from other modules. If they live
> in a .pxd file, then you get inlining in all modules that cimport that .pxd
> file.

Makes sense. Thanks :-)

Nathann
Reply all
Reply to author
Forward
0 new messages