GNOME Bugzilla – Bug 643993
virtual inline functions interpreted as inline with potential overloading
Last modified: 2018-05-22 13:57:13 UTC
Currently if a method is defined as virual inline it behaves in effect as normal virtual: public interface Test { public inline virtual int f(int i) { return i+1; } } ------ // In .c static inline gint test_real_f (Test* self, gint i) { gint result = 0; result = i + 1; return result; } However it might be benefitial to interpret it as a inline in header: public interface Test { public inline virtual int f(int i) { return i+1; } } ----- // In .h static inline gint test_f (Test* self, gint i) { if (TEST_GET_INTERFACE (self)->f != NULL) return TEST_GET_INTERFACE (self)->f (self, i); gint result = 0; result = i + 1; return result; } Why it may be benefitial: If anyone uses highier order functions the inlining tends to be imporant for performance. If compiler is allowed to do inlining it may optimise the call to loop instead of call to function which calls in loop.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/177.