Re: [HACKERS] Questionable codes
От | Tom Lane |
---|---|
Тема | Re: [HACKERS] Questionable codes |
Дата | |
Msg-id | 15564.945188604@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Questionable codes (Tatsuo Ishii <t-ishii@sra.co.jp>) |
Список | pgsql-hackers |
Tatsuo Ishii <t-ishii@sra.co.jp> writes: > 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 Probably, but I'm not sure it really makes any difference. We add on 10% or so slop after we've finished adding up all these numbers, anyway ;-) > 2) in utils/hash/dynahash.c:hash_search(): > Assert(saveState.currElem && !(saveState.currElem = 0)); > Does anybody know what it is for? That's part of that horribly ugly, non-reentrant HASH_REMOVE_SAVED interface, isn't it? I have a to-do item to rip that code out and replace it with a more reasonable design ... in the meantime, I don't think it much matters whether the Assert could be tightened up ... regards, tom lane
В списке pgsql-hackers по дате отправления: