| Paul Pluzhnikov 2005-11-24, 2:48 am |
| "Maxim Yegorushkin" <maxim.yegorushkin@gmail.com> writes:
> "Nilesh" <nileshg@gmail.com> writes:
Nilesh,
Are you using GNU-ld or solaris 'ld' ?
Did you build libstdc++.a which you statically link into yor DSO
with -fPIC, or are you using the non-PIC version that is normally
built when building g++?
[vbcol=seagreen]
And what *is* your reason?
And do you realize that statically linking libstdc++.a into your DSO
makes the DSO GPLd as well?
[vbcol=seagreen]
> This is probably because doing so you get two c++ runtimes in your
> process. Memory allocated by one can not be freed by another.
Maxim,
You are mistaken (carrying with you Win32 garbage).
On UNIX, memory allocated (via malloc(), calloc(), realloc(),
etc.) by one DSO can be free()d by another DSO or the main executable
(under all "normal" circumstances).
> The solution to this is either link to libstdc++ dynamically, so that
> you get single c++ runtime in your process, or rewrite the .so and its
> users so that memory get allocated and freed in the same module.
Untrue. More Win32 garbage.
Cheers,
--
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
|