How about add counted_by attribute for flexible-array?

Поиск
Список
Период
Сортировка
От Japin Li
Тема How about add counted_by attribute for flexible-array?
Дата
Msg-id ME3P282MB3166210CDE36BD485B703BF6B6C82@ME3P282MB3166.AUSP282.PROD.OUTLOOK.COM
обсуждение исходный текст
Список pgsql-hackers
Hi, hackers

When I read [1], I think the "counted_by" attribute may also be valuable for
PostgreSQL.

The 'counted_by' attribute is used on flexible array members. The argument for
the attribute is the name of the field member in the same structure holding
the count of elements in the flexible array. This information can be used to
improve the results of the array bound sanitizer and the
'__builtin_dynamic_object_size' builtin [2].

It was introduced in Clang-18 [3] and will soon be available in GCC-15.

[1] https://embeddedor.com/blog/2024/06/18/how-to-use-the-new-counted_by-attribute-in-c-and-linux/
[2] https://reviews.llvm.org/D148381
[3] https://godbolt.org/z/5qKsEhG8o

-- 
Regrads,
Japin Li



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

Предыдущее
От: John Naylor
Дата:
Сообщение: Re: 回复: An implementation of multi-key sort
Следующее
От: John Naylor
Дата:
Сообщение: Re: Speed up collation cache