This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Dynamic Loading of Class Implementation at Runtime.


> I don't quite understand.  There's no important difference between the
> implementation of C functions and C++ methods, from the point of view
> of a shared library.

There is another use of shared libraries, other than just sharing the
library. That other use is dynamic code loading. 

In C, you can very nicely have a long-running system, and replace the
implementation of some functions on-the-fly. You can add and remove
functions, and change the implementation of existing functions. It
will work as long as you don't change the signature of existing
functions.

In C++, there are much more hidden restrictions. You must not add
virtual functions, and you must not add members to classes, and you
better not have globals in your shared library. This essentially means
that you cannot modify your implementation in an interesting way
without breaking binary compatibility. Apparently, this is an issue
to some people.

Regards,
Martin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]