Re: Speed up clean meson builds by ~25%

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Speed up clean meson builds by ~25%
Дата
Msg-id 3883695.1712703641@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Speed up clean meson builds by ~25%  (Andres Freund <andres@anarazel.de>)
Ответы Re: Speed up clean meson builds by ~25%  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> I think we need to do something about the compile time of this file, even with
> gcc. Our main grammar already is an issue and stacking all the ecpg stuff on
> top makes it considerably worse.

Seems reasonable, if we can.

> Why are strduping all of these?

IIRC, the issue is that the mechanism for concatenating the tokens
back together frees the input strings

static char *
cat2_str(char *str1, char *str2)
{
    char * res_str    = (char *)mm_alloc(strlen(str1) + strlen(str2) + 2);

    strcpy(res_str, str1);
    if (strlen(str1) != 0 && strlen(str2) != 0)
        strcat(res_str, " ");
    strcat(res_str, str2);
    free(str1);          <------------------
    free(str2);          <------------------
    return res_str;
}

So that ought to dump core if you don't make all the productions
return malloc'd strings.  How did you work around that?

(Maybe it'd be okay to just leak all the strings?)

            regards, tom lane



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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: Allow non-superuser to cancel superuser tasks.
Следующее
От: Alexander Korotkov
Дата:
Сообщение: Re: Add SPLIT PARTITION/MERGE PARTITIONS commands