Sorry for the slow reply.

On Tue, 9 Mar 1999, Jean-Marc Lasgouttes wrote:

> >>>>> "Allan" == Allan Rae <[EMAIL PROTECTED]> writes:
> 
> Allan> // Allan (ARRae) // Example code for using signals to reduce
> Allan> the need for rtti or // inset codes.  No need to identify
> Allan> insets, they identify themselves by // connecting to
> Allan> appropriate signals.  This scheme means we don't have // to
> Allan> scan a buffer looking for particular inset types.  // 
> 
> What is the memory cost of this scheme? Are signals efficiently stored
> in memory?

For our current gtk--signals:
Each Signal and each class derived from SignalBase has effectively
five pointers.

Every connection that is then made between a Signal and method in that
class adds another 7 pointers plus however many callback data pointers are
required.  The Signal and the class each has a doubly linked list and the
list element is common to both lists. 

Each Connection has a single pointer to a list element.

Thus for a 32-bit machine every signal or derived class adds 20bytes.
Every connection that we then make adds another 28+4n bytes where n is the
number of callback data parameters.  Since we aren't using callbacks at
present and only connect to methods and not functions or other signals
(except one case in Popups::Popups()) the its safe to say that each
connection adds 28 bytes.

The situation is similar for the libsigc++ implementation I think.

Allan. (ARRae)

Reply via email to