Re: dynamic library question



James Henstridge wrote:

> The static keyword on functions and variables is simply a scoping keyword
> when used outside of a block.  It is similar to the private keyword in
> C++/Java.
>
> With dynamic libraries, only the code section and const data portions are
> shared between applications.  Other data is per application.
>
> James.
>
> --
> Email: james@daa.com.au
> WWW:   http://www.daa.com.au/~james/
>
> On Sun, 15 Aug 1999, Daniel Weber wrote:
>
> > This is not gnome-devel related, per se, but here goes....
> >
> > I've discovered several gtk functions that declare static variables
> > inside routines.  My question is, since gtk is a dynamically shared
> > library, how are these variables handled?  It seems like all programs
> > would share the variables value (maybe this is the intent?)  Obviously a
> > staticly linked program would get it's own copy if it was intentional,
> > though....
> >
> > Just wondering how this was handled...
> >
> >
> > --
> > To unsubscribe: mail gnome-devel-list-request@gnome.org with "unsubscribe"
> > as the Subject.
> >
>
> --
> To unsubscribe: mail gnome-devel-list-request@gnome.org with "unsubscribe"
> as the Subject.

For some reason I was under the impression that the static keyword inside a
function meant that the value of the variable would be maintained between
function calls.  If the code in question is a shared library, where would the
variable be stored and linked?



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]