Re: [HACKERS] Questionable codes

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [HACKERS] Questionable codes
Дата
Msg-id 199912141625.LAA14511@candle.pha.pa.us
обсуждение исходный текст
Ответ на Questionable codes  (Tatsuo Ishii <t-ishii@sra.co.jp>)
Список pgsql-hackers
> I have found a few questionable codings. I'm not sure if it really
> hurts anything. Suggestions are welcome.
> 
> 1) in storage/lmgr/lock.c: LockShmemSize()
> 
> size += MAXALIGN(maxBackends * sizeof(PROC));        /* each MyProc */
> size += MAXALIGN(maxBackends * sizeof(LOCKMETHODCTL));        /* each
> 
> shouldn't be:
> 
> size += maxBackends * MAXALIGN(sizeof(PROC));        /* each MyProc */
> size += maxBackends * MAXALIGN(sizeof(LOCKMETHODCTL));        /* each

Yes, you are correct.  The bottom one is better.

> 
> 2) in utils/hash/dynahash.c:hash_search():
> 
> Assert(saveState.currElem && !(saveState.currElem = 0));
> 
> Does anybody know what it is for?

No idea.

--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


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

Предыдущее
От: Karel Zak - Zakkr
Дата:
Сообщение: Re: [HACKERS] Datatype MONEY
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Questionable codes