Re: A few more opportunities to use TupleTableSlotOps fields

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: A few more opportunities to use TupleTableSlotOps fields
Дата
Msg-id 20190521163920.hvibbhmybqrjaoe5@alap3.anarazel.de
обсуждение исходный текст
Ответ на Re: A few more opportunities to use TupleTableSlotOps fields  (Antonin Houska <ah@cybertec.at>)
Список pgsql-hackers
Hi,

On 2019-05-21 16:47:50 +0200, Antonin Houska wrote:
> I admit I didn't think about this problem. Nevertheless I imagine that due to
> constness of the variables like TTSOpsVirtual (and due to several other const
> declarations) the compiler might be able to compute the address of the
> tts_ops->clear() expression.

It really can't, without actually fetching tts_ops, and reading the
callback's location. How would e.g. tts_virtual_copyslot() know that the
slot's tts_ops point to TTSOpsVirtual? There's simply no way to express
that in C.  If this were a class in C++, the compiler would have decent
chance at it these days (because if it's a final method it can infer
that it has to be, and because whole program optimization allows
devirtualization passes to do so), but well, it's not.

And then there's the whole inlining issue explained in my other recent
mail on the topic.

Greetings,

Andres Freund



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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: A few more opportunities to use TupleTableSlotOps fields
Следующее
От: Andres Freund
Дата:
Сообщение: Re: POC: Cleaning up orphaned files using undo logs