> I wonder: what does actually happen when you "create" a static object in
> the middle of a method?

Same as if you create it in the beginning of the method :-) it gets
initialized before it's first used, that's guaranteed; whether
it's actually done before the function first runs or before the
block first gets executed, is unspecified.

> Where does it get stored?

In the static data section of the memory.

> When does it get released?

Never. Static vars are just like extern vars, the only difference being
that they are only accessed within the lexical scope that they're defined
in (can be the whole file if defined outside a function, i.e., external
static).

> Does it create a higher static memory footprint? (Does it's size matter?)

Yes, but the 10 or so exceptions I've created with less than 50 string
static objects overall don't matter that much, I hope (we're a several
tens of megabytes binary image anyway already).

> I haven't really looked into the patches but what you describe sounds
> good to me.

Thanks.

Vassilii


_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

Reply via email to