Run pgindent on generic_xlog.c.
This code desperately needs some micro-optimization, and I'd like it to be formatted a bit more nicely while I work on it.
This commit is contained in:
parent
381200be4b
commit
2dd318d277
|
@ -171,14 +171,15 @@ writeDelta(PageData *pageData)
|
||||||
BLCKSZ - fragmentBegin,
|
BLCKSZ - fragmentBegin,
|
||||||
page + fragmentBegin);
|
page + fragmentBegin);
|
||||||
|
|
||||||
#ifdef WAL_DEBUG
|
|
||||||
/*
|
/*
|
||||||
* If xlog debug is enabled, then check produced delta. Result of delta
|
* If xlog debug is enabled, then check produced delta. Result of delta
|
||||||
* application to saved image should be the same as current page state.
|
* application to saved image should be the same as current page state.
|
||||||
*/
|
*/
|
||||||
|
#ifdef WAL_DEBUG
|
||||||
if (XLOG_DEBUG)
|
if (XLOG_DEBUG)
|
||||||
{
|
{
|
||||||
char tmp[BLCKSZ];
|
char tmp[BLCKSZ];
|
||||||
|
|
||||||
memcpy(tmp, image, BLCKSZ);
|
memcpy(tmp, image, BLCKSZ);
|
||||||
applyPageRedo(tmp, pageData->data, pageData->dataLen);
|
applyPageRedo(tmp, pageData->data, pageData->dataLen);
|
||||||
if (memcmp(tmp, page, pageLower)
|
if (memcmp(tmp, page, pageLower)
|
||||||
|
@ -218,6 +219,7 @@ GenericXLogRegister(GenericXLogState *state, Buffer buffer, bool isNew)
|
||||||
for (block_id = 0; block_id < MAX_GENERIC_XLOG_PAGES; block_id++)
|
for (block_id = 0; block_id < MAX_GENERIC_XLOG_PAGES; block_id++)
|
||||||
{
|
{
|
||||||
PageData *page = &state->pages[block_id];
|
PageData *page = &state->pages[block_id];
|
||||||
|
|
||||||
if (BufferIsInvalid(page->buffer))
|
if (BufferIsInvalid(page->buffer))
|
||||||
{
|
{
|
||||||
page->buffer = buffer;
|
page->buffer = buffer;
|
||||||
|
@ -225,7 +227,7 @@ GenericXLogRegister(GenericXLogState *state, Buffer buffer, bool isNew)
|
||||||
BGP_NO_SNAPSHOT_TEST), BLCKSZ);
|
BGP_NO_SNAPSHOT_TEST), BLCKSZ);
|
||||||
page->dataLen = 0;
|
page->dataLen = 0;
|
||||||
page->fullImage = isNew;
|
page->fullImage = isNew;
|
||||||
return (Page)page->image;
|
return (Page) page->image;
|
||||||
}
|
}
|
||||||
else if (page->buffer == buffer)
|
else if (page->buffer == buffer)
|
||||||
{
|
{
|
||||||
|
@ -233,7 +235,7 @@ GenericXLogRegister(GenericXLogState *state, Buffer buffer, bool isNew)
|
||||||
* Buffer is already registered. Just return the image, which is
|
* Buffer is already registered. Just return the image, which is
|
||||||
* already prepared.
|
* already prepared.
|
||||||
*/
|
*/
|
||||||
return (Page)page->image;
|
return (Page) page->image;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -372,7 +374,8 @@ GenericXLogAbort(GenericXLogState *state)
|
||||||
static void
|
static void
|
||||||
applyPageRedo(Page page, Pointer data, Size dataSize)
|
applyPageRedo(Page page, Pointer data, Size dataSize)
|
||||||
{
|
{
|
||||||
Pointer ptr = data, end = data + dataSize;
|
Pointer ptr = data,
|
||||||
|
end = data + dataSize;
|
||||||
|
|
||||||
while (ptr < end)
|
while (ptr < end)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue