Re: possible memory leak in Server Status window

Поиск
Список
Период
Сортировка
От Peter Geoghegan
Тема Re: possible memory leak in Server Status window
Дата
Msg-id AANLkTi=0LFEfy-Au0fNnNfmR6ktxHEmWPCDC7+RonYeR@mail.gmail.com
обсуждение исходный текст
Ответ на Re: possible memory leak in Server Status window  (Dave Page <dpage@pgadmin.org>)
Список pgadmin-support
On 11 February 2011 15:04, Dave Page <dpage@pgadmin.org> wrote:

> Ashesh had some code to implement a smart pointer a while back. I
> suggested he post it here, but I know he's been too busy to do much
> else with it.container

I would prefer to use a stdlib smart ptr, or a well tested third party
smart ptr that we can adopt ourselves. std::auto_ptr has been in the
standard for a long time, so it really isn't that unreasonable to
expect it to be on supported platforms. It is totally no-throwing. On
the other hand, it will soon be deprecated. There are lots of
subtleties to writing a smart pointer class. I seem to recall Scott
Meyers complaining about the amount of errata he had to write when he
rolled his own smart pointer class for either the first or second
edition of Effective C++. Granted, that probably had plenty to do with
exception safety and exception neutrality, which we basically don't
have to worry about, but I think some of the same concerns still
apply.

>> Alternatively we could abandon pointer semantics and write our own
>> RAII wrapper class. This would be a large patch.
>
> Exactly.

It also has the disadvantage of there being no reasonable way to avoid
a deep copy when returning from a function without using C++0x's
rvalue references.

-- 
Regards,
Peter Geoghegan


В списке pgadmin-support по дате отправления:

Предыдущее
От: Dave Page
Дата:
Сообщение: Re: possible memory leak in Server Status window
Следующее
От: Guillaume Lelarge
Дата:
Сообщение: Re: possible memory leak in Server Status window