Commit 2dd318d2 authored by Tom Lane's avatar Tom Lane

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.
parent 381200be
......@@ -171,14 +171,15 @@ writeDelta(PageData *pageData)
BLCKSZ - fragmentBegin,
page + fragmentBegin);
#ifdef WAL_DEBUG
/*
* If xlog debug is enabled, then check produced delta. Result of delta
* application to saved image should be the same as current page state.
*/
#ifdef WAL_DEBUG
if (XLOG_DEBUG)
{
char tmp[BLCKSZ];
memcpy(tmp, image, BLCKSZ);
applyPageRedo(tmp, pageData->data, pageData->dataLen);
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++)
{
PageData *page = &state->pages[block_id];
if (BufferIsInvalid(page->buffer))
{
page->buffer = buffer;
......@@ -225,7 +227,7 @@ GenericXLogRegister(GenericXLogState *state, Buffer buffer, bool isNew)
BGP_NO_SNAPSHOT_TEST), BLCKSZ);
page->dataLen = 0;
page->fullImage = isNew;
return (Page)page->image;
return (Page) page->image;
}
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
* already prepared.
*/
return (Page)page->image;
return (Page) page->image;
}
}
......@@ -372,7 +374,8 @@ GenericXLogAbort(GenericXLogState *state)
static void
applyPageRedo(Page page, Pointer data, Size dataSize)
{
Pointer ptr = data, end = data + dataSize;
Pointer ptr = data,
end = data + dataSize;
while (ptr < end)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment