Libing Song wrote:
> Hi Zhenxing,
> Thanks for your review.
> The new patch has been committed, please review again.
>
> On Thu, 2010-01-28 at 12:07 +0800, He Zhenxing wrote:
> > > +
> > > + TranxNode *allocate_node()
> > > + {
> > > + TranxNode *trx_node;
> > > + Block *block= current_block;
> > > +
> > > + if (last_node == BLOCK_TRANX_NODES-1)
> > > + {
> > > + current_block= current_block->next;
> > > + last_node= -1;
> > > + }
> > > +
> > > + if (current_block == NULL && allocate_block())
> > > + {
> > > + current_block= block;
> > > + if (current_block)
> > > + last_node= BLOCK_TRANX_NODES-1;
> > > + return NULL;
> > > + }
> > > +
> >
> > I'd suggest:
> >
> > if (last_node == BLOCK_TRANX_NODES-1)
> > {
> > if (current_block->next != NULL)
> > current_block = current_block->next;
> > else if (allocate_block())
> > return NULL;
> > last_node = -1;
> > }
> 'if (current_block == NULL && allocate_block())'
> is still needed, for current_block is null when starting up.
>
OK
>
>
>