After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 643993 - virtual inline functions interpreted as inline with potential overloading
virtual inline functions interpreted as inline with potential overloading
Status: RESOLVED OBSOLETE
Product: vala
Classification: Core
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2011-03-06 02:09 UTC by Maciej (Matthew) Piechotka
Modified: 2018-05-22 13:57 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Maciej (Matthew) Piechotka 2011-03-06 02:09:32 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.
Comment 1 GNOME Infrastructure Team 2018-05-22 13:57:13 UTC
-- 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.