Calling inline functions

Samuel Audet samuel.audet at gmail.com
Tue Apr 21 01:04:29 UTC 2020


The problem with that approach though is that inline functions are 
typically inline because the developer found that for performance 
reasons they should be executed inline! Wrapping them up in non-inline 
functions nullifies their purpose.

Conversely, worrying about how fast we can call non-inline functions is 
counterproductive.

Samuel

On 4/20/20 11:55 PM, Maurizio Cimadamore wrote:
> Strictly speaking, it is an API client (which can be used w/ or w/o 
> jextract).
> 
> E.g. what is needed is a visitor which reads the inline function/macro 
> and then generates the required C plumbing.
> 
> Maurizio
> 
> On 20/04/2020 15:44, Ty Young wrote:
>> That's disappointing. Instead of jextract, could it be added into the 
>> core API somehow?
>>
>>
>> On 4/20/20 8:25 AM, Maurizio Cimadamore wrote:
>>> Inline functions do not exist in the .so/.dll/.dynlib file. They are 
>>> essentially function-like macros, expanded by the compiler whenever 
>>> they are used.
>>>
>>> If you want to call them using the current support you need to create 
>>> your own C library wrapper which exposes the additional symbol (as a 
>>> regular function) and then calls the corresponding inline function. 
>>> Then you extract your header (which will also include the original 
>>> header you wanted to work on) with jextract.
>>>
>>> In the future we might automate support for function-like macro a 
>>> little, by providing jextract API plugins which generate the correct 
>>> plumbings.
>>>
>>> Maurizio
>>>


More information about the panama-dev mailing list