Re: How to compile, link and use a C++ extension

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: How to compile, link and use a C++ extension
Дата
Msg-id 20150814181647.GM4955@awork2.anarazel.de
обсуждение исходный текст
Ответ на Re: How to compile, link and use a C++ extension  (Peter Geoghegan <pg@heroku.com>)
Список pgsql-hackers
On 2015-08-14 11:10:14 -0700, Peter Geoghegan wrote:
> On Fri, Aug 14, 2015 at 10:28 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> > Yeah.  The painful issues you're going to face are not that.  They are
> > memory management (C++ "new" does not talk to palloc or vice versa)
> > and error handling ("throw" does not interoperate with PG_TRY()).
> 
> It's worse than that. Any use of longjmp() will cause undefined
> behavior in C++. That's because each C++ object's destructor will not
> be called (possibly other reasons, too).

Only if that longjmp goes through C++ code with non-POD objects. Which
you should pretty much never allow.

- Andres



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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: How to compile, link and use a C++ extension
Следующее
От: Andrew Dunstan
Дата:
Сообщение: Re: Management of simple_eval_estate for plpgsql DO blocks