[PATCH] dynahash.c refactoring

Поиск
Список
Период
Сортировка
Искать

[PATCH] dynahash.c refactoring

От:
Aleksander Alekseev <aleksander@tigerdata.com>
Дата:
Вложения:
Hi,

0001: hash_freeze() has not been used since 5dfc198146 (Oct 2016). I
suggest removing it.

0002: hash_destroy() is the only caller of hash_stats(). I suggest
making the function static and place it under `#ifdef
HASH_STATISTICS`.

Thoughts?

-- 
Best regards,
Aleksander Alekseev

Re: [PATCH] dynahash.c refactoring

От:
Peter Eisentraut <peter@eisentraut.org>
Дата:
On 29.10.26 12:03, Aleksander Alekseev wrote:
> 0001: hash_freeze() has not been used since 5dfc198146 (Oct 2016). I
> suggest removing it.

This seems alright.  If someone needs it, we can put it back.

> 0002: hash_destroy() is the only caller of hash_stats(). I suggest
> making the function static and place it under `#ifdef
> HASH_STATISTICS`.

I don't think this is an improvement.  In general, I would like to keep 
the amount of code covered by #ifdef's as small as possible.  That way, 
we reduce the chances that some code rots because it is not compiled by 
default.  We could make the function static, but I would avoid the 
additional #ifdef's.



Re: [PATCH] dynahash.c refactoring

От:
Aleksander Alekseev <aleksander@tigerdata.com>
Дата:
Вложения:
Hi Peter,

> > 0001: hash_freeze() has not been used since 5dfc198146 (Oct 2016). I
> > suggest removing it.
>
> This seems alright.  If someone needs it, we can put it back.
>
> > 0002: hash_destroy() is the only caller of hash_stats(). I suggest
> > making the function static and place it under `#ifdef
> > HASH_STATISTICS`.
>
> I don't think this is an improvement.  In general, I would like to keep
> the amount of code covered by #ifdef's as small as possible.  That way,
> we reduce the chances that some code rots because it is not compiled by
> default.  We could make the function static, but I would avoid the
> additional #ifdef's.

Thanks for the feedback. Here are the corrected patches.

-- 
Best regards,
Aleksander Alekseev

Re: [PATCH] dynahash.c refactoring

От:
Peter Eisentraut <peter@eisentraut.org>
Дата:
On 03.11.26 11:19, Aleksander Alekseev wrote:
> Hi Peter,
> 
>>> 0001: hash_freeze() has not been used since 5dfc198146 (Oct 2016). I
>>> suggest removing it.
>>
>> This seems alright.  If someone needs it, we can put it back.
>>
>>> 0002: hash_destroy() is the only caller of hash_stats(). I suggest
>>> making the function static and place it under `#ifdef
>>> HASH_STATISTICS`.
>>
>> I don't think this is an improvement.  In general, I would like to keep
>> the amount of code covered by #ifdef's as small as possible.  That way,
>> we reduce the chances that some code rots because it is not compiled by
>> default.  We could make the function static, but I would avoid the
>> additional #ifdef's.
> 
> Thanks for the feedback. Here are the corrected patches.

I have committed the patch to remove hash_freeze().

About hash_stats(), the header comment in dynahash.c still mentioned 
hash_stats() as a public interface.  That would have to be adjusted.  On 
further thought, let's just leave that alone.  There is nothing wrong 
with having this as an external interface, for example to debug the hash 
table usage of some algorithm.



FAQ