Review: Hot standby
От | Pavan Deolasee |
---|---|
Тема | Review: Hot standby |
Дата | |
Msg-id | 2e78013d0811202352s7ca6f43fs4c146df296636f9b@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: Review: Hot standby
Re: Review: Hot standby |
Список | pgsql-hackers |
<br />I think we should avoid the #define's like below which uses a local variable. I guess the same #define is used elsewherein the code as well. If the code is rearranged or the variable name is changed, the code would break.<br /><br />Theuse of malloc should also be avoided (unless the memory subsystem is not up yet; I haven't checked).<br /><br /><br/>***************<br />*** 706,713 ****<br /> (errcode(ERRCODE_OUT_OF_MEMORY),<br /> errmsg("out of memory")));<br /> Assert(snapshot->subxip == NULL);<br /> snapshot->subxip= (TransactionId *)<br />! malloc(arrayP->maxProcs * PGPROC_MAX_CACHED_SUBXIDS * sizeof(TransactionId));<br/> if (snapshot->subxip == NULL)<br /> ereport(ERROR,<br /> (errcode(ERRCODE_OUT_OF_MEMORY),<br />--- 1003,1011 ----<br /> (errcode(ERRCODE_OUT_OF_MEMORY),<br/> errmsg("out of memory")));<br /> Assert(snapshot->subxip== NULL);<br />+ #define maxNumSubXids (arrayP->maxProcs * PGPROC_MAX_CACHED_SUBXIDS)<br /> snapshot->subxip = (TransactionId *)<br />! malloc(maxNumSubXids * sizeof(TransactionId));<br /> if (snapshot->subxip == NULL)<br /> ereport(ERROR,<br /> (errcode(ERRCODE_OUT_OF_MEMORY),<br/><br /><br clear="all" />Thanks,<br />Pavan<br /><br />-- <br />Pavan Deolasee<br />EnterpriseDB <a href="http://www.enterprisedb.com">http://www.enterprisedb.com</a><br />
В списке pgsql-hackers по дате отправления: