C# class instantiation const string -
i've read const string objects stored value , have value assigned @ compile time. mean memory allocated if encapsulating class not instantiated i.e. can waste heap space if const keyword on used (too many const strings)?
edit: context...
i require lot of constant value string
objects, definately used , others used depending on user's interaction (i.e. specific use cases only). 1st set of string know used have declared in static
class const
objects. remaining strings, should declared const
or use unnecessary heap space if specific use cases never triggered?
if strings static properties of class allocated if not no allocated until instanciated
string interning proccess thast used improve memory , heap usage , allow more efficient string comparison
http://en.wikipedia.org/wiki/string_interning
http://broadcast.oreilly.com/2010/08/understanding-c-stringintern-m.html
Comments
Post a Comment