Re: virtual inline vs inline

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4 November 2013 13:33, Norbert Dajka wrote:
> Hello,
>
> I would like to know, if there is any difference (in allocated memory
> space) between defining a function inline in the class declaration
> (with the inline word), and defining a function inline explicit after
> the class declaration.

There is no difference.

> In addition, does anybody know, why a previously only inline declared
> function takes up more memory space, if it's declared virtual inline
> (even if the classes to which the declaring class of the function is a
> parent class doesn't have their own implementation)?

Because virtual functions need additional metadata in the class,
specifically in the ABI used by G++ the class must have a pointer to
the vtable (if it didn't have one already) and the vtable will have an
additional entry for the virtual function.




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux