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

Re: Sv: Sv: Memory allocators



Peter Burns wrote:

>>If the first allocation here fails, everything is fine. But if the second
>>one fails we have a memory leak.
>
>This is why using auto_ptr is important if you care about resource leaks
>caused by exceptions.
>It might be good idea to use the string class rather than c strings

Generally yes, but AFAIK both auto_ptr and string have some very real
overhead - too much for speed critical code.
Perhaps auto_ptr is ok, I don't know. But string *is* too heavy.


	Christian
--

Drive A: not responding...Formatting C: instead