Re: what is the need for copy constructor in String class?



Piper707@xxxxxxxxxxx wrote:
Thank you to everyone who responded, specially Eric - that was a clear
explanation.

With regards to Joshua's comment, if literals do not get garbage
collected, would that not pose a problem from a memory point of view
if my program has a lot of strings? Does the size of the string
constant pool vary dynamically or is it fixed?

You can't create new string literals/constants at runtime, so this
isn't a problem.

--
Steve Wampler -- swampler@xxxxxxxx
The gods that smiled on your birth are now laughing out loud.
.



Relevant Pages

  • Re: memory allocation questions (newbie)
    ... I might want to allocate an array of strings. ... [releasing memory once it is no longer required]. ... Reading email is like searching for food in the garbage, ...
    (comp.lang.c)
  • Re: .NET SUCKS --- READ FOLLOWING. MICROSOFT IS A SUCKY CO
    ... > system just doesn't cut it in high memory load situations. ... Garbage Collection is not an excuse for poor memory management. ... One excellent example is the use of strings. ... because many "professional" programmers know very little about what is ...
    (microsoft.public.dotnet.framework)
  • Re: Secure Credentials pwd handling
    ... strings that are produced when you read the properties. ... Co-author of "The .NET Developer's Guide to Directory Services Programming" ... so at some point the value will be in memory. ... SecureString is added to .NET to support this use case. ...
    (microsoft.public.dotnet.security)
  • Re: CStrings and memory
    ... Then you allocate a few more strings ... Now you need to allocate another string, but there is no more memory. ... In addition to strings, there are other things that get allocated: ... have perhaps confused "address space" with "working set". ...
    (microsoft.public.vc.mfc)
  • Re: Verbose functional languages?
    ... whereas a memory leak due to too much laziness in the wrong place can be. ... If you declare your data structure elements as strict, ... I think size matters, for the optimization heuristics. ... strings for symbol names. ...
    (comp.lang.functional)