c++ - Static Global Fields in a Shared Library - Where do they go? -
I have a CPP file from which I am creating a shared library (autofoo and so on). In the CPP file, I have declared some static fields which I use in full library work.
My question is 2-part:
1) Where are they remember? It is not that the system provides the entire library immediately and keeps it in memory ... The library is, in fact, only a bunch of hooks.
2) Is there a better way to do this? The reason for this is that I did it to start that I want to save the user from the need to pass the fields as parameters in every library function call.
Thanks
Note: The shared Lib loader does not have to do this at all load points. Any Global Stack POD Variable (things without any constructor) Special Memory Segment will be stored on the basis of the weather, whether or not they have been initialized (again an implementation description). If they have already begun, they will already be loaded with a set price (or shared lib creation) with the set price. Then answer your questions: Generally (there are minor technical differences in each): < / P>
It can make some of these work lazy (implementation details). But they will be used before use.
Comments
Post a Comment