You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the cobj generator declare a function in the .h file of the interface, and the implementation is in the interface-registry file, like:
// in interface.h
int interface_foo(interface * self, int j);
// in interface_registry.c
int interface_foo(interface * self, int j)
{
return self->mt->foo(self->object, j);
}
This "forwarder" method could be inlined by the compiler, if the cobj generator would emit it with the "inline" keyword in the header. This would have this advantages:
it would reduce the overhead of calling an cobj interface method for one function call
if we could just use default references (see Consider "Default References" #10), then we would not need queryinterface at all, allowing us also to get rid of the interface-descriptor, and so get rid of the interface_registry completely.
Currently the cobj generator declare a function in the .h file of the interface, and the implementation is in the interface-registry file, like:
This "forwarder" method could be inlined by the compiler, if the cobj generator would emit it with the "inline" keyword in the header. This would have this advantages: