Re: Simplify newNode()

Поиск
Список
Период
Сортировка
От Junwang Zhao
Тема Re: Simplify newNode()
Дата
Msg-id CAEG8a3+yOM5tngjiCtxKA1F2NeVQ16AvbvPnnhELALSnDDQKEw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Simplify newNode()  (Zhang Mingli <zmlpostgres@gmail.com>)
Список pgsql-hackers
On Thu, Dec 14, 2023 at 9:34 AM Zhang Mingli <zmlpostgres@gmail.com> wrote:
>
> Hi,
>
> LGTM.
>
> + Assert(size >= sizeof(Node)); /* need the tag, at least */
> + result = (Node *) palloc0fast(size);
> + result->type = tag;
>
> + return result;
> +}
>
> How about moving the comments /* need the tag, at least */ after result->type = tag; by the way?

I don't think so, the comment has the meaning of the requested size
should at least the size
of Node, which contains just a NodeTag.

typedef struct Node
{
NodeTag type;
} Node;

>
>
>
> Zhang Mingli
> www.hashdata.xyz



--
Regards
Junwang Zhao



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

Предыдущее
От: Zhang Mingli
Дата:
Сообщение: Re: Simplify newNode()
Следующее
От: NINGWEI CHEN
Дата:
Сообщение: Re: Remove MSVC scripts from the tree