This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Dynamic Loading of Class Implementation at Runtime.
- To: oliva at dcc dot unicamp dot br
- Subject: Re: Dynamic Loading of Class Implementation at Runtime.
- From: Martin von Loewis <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Sat, 12 Dec 1998 10:29:06 +0100
- Cc: egcs at cygnus dot com
- References: <366F6850.9A1FA95A@gte.net> <orogpcdoy8.fsf@araguaia.dcc.unicamp.br>
> 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