[linux-audio-dev] Static class data and dlopen()

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: [linux-audio-dev] Static class data and dlopen()
From: Alfons Adriaensen (fons.adriaensen_AT_alcatel.be)
Date: Mon May 19 2003 - 15:20:18 EEST


This is not strictly a Linux Audio question, but I encountered
this matter in the context of writing LADSPA plugins, so...

Imagine you have a C++ class S which has some static data.
Derive A from S and use A to create a plugin a.so
Derive B from S and use B to create a plugin b.so

When a host links (at runtime) with both a.so and b.so,
then the static data from S will be created twice (I verified
this to be the case).

This is what I expected, but it may shock C++ purists, so my
question now is this:

Is this the 'official' behaviour when loading plugins, or is this
something that could change with future version of g++ and the DL libs ?

Fons


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Mon May 19 2003 - 15:28:08 EEST