case 'P': /* parse */
doing_extended_query_message = true;
/* these are only legal in protocol 3 */
- if (PG_PROTOCOL_MAJOR(FrontendProtocol) < 3)
+ if (unlikely(PG_PROTOCOL_MAJOR(FrontendProtocol) < 3))
ereport(FATAL,
(errcode(ERRCODE_PROTOCOL_VIOLATION),
errmsg("invalid frontend message type %d", qtype)));
/* mark not-extended, so that a new error doesn't begin skip */
doing_extended_query_message = false;
/* only legal in protocol 3 */
- if (PG_PROTOCOL_MAJOR(FrontendProtocol) < 3)
+ if (unlikely(PG_PROTOCOL_MAJOR(FrontendProtocol) < 3))
ereport(FATAL,
(errcode(ERRCODE_PROTOCOL_VIOLATION),
errmsg("invalid frontend message type %d", qtype)));
case 'f': /* copy fail */
doing_extended_query_message = false;
/* these are only legal in protocol 3 */
- if (PG_PROTOCOL_MAJOR(FrontendProtocol) < 3)
+ if (unlikely(PG_PROTOCOL_MAJOR(FrontendProtocol) < 3))
ereport(FATAL,
(errcode(ERRCODE_PROTOCOL_VIOLATION),
errmsg("invalid frontend message type %d", qtype)));
int numParams;
Oid *paramTypes = NULL;
- forbidden_in_wal_sender(firstchar);
+ if (unlikely(am_walsender))
+ forbidden_in_wal_sender(firstchar);
/* Set statement_timestamp() */
SetCurrentStatementStartTimestamp();
break;
case 'B': /* bind */
- forbidden_in_wal_sender(firstchar);
+ if (unlikely(am_walsender))
+ forbidden_in_wal_sender(firstchar);
/* Set statement_timestamp() */
SetCurrentStatementStartTimestamp();
const char *portal_name;
int max_rows;
- forbidden_in_wal_sender(firstchar);
+ if (unlikely(am_walsender))
+ forbidden_in_wal_sender(firstchar);
/* Set statement_timestamp() */
SetCurrentStatementStartTimestamp();
break;
case 'F': /* fastpath function call */
- forbidden_in_wal_sender(firstchar);
+ if (unlikely(am_walsender))
+ forbidden_in_wal_sender(firstchar);
/* Set statement_timestamp() */
SetCurrentStatementStartTimestamp();
int close_type;
const char *close_target;
- forbidden_in_wal_sender(firstchar);
+ if (unlikely(am_walsender))
+ forbidden_in_wal_sender(firstchar);
close_type = pq_getmsgbyte(&input_message);
close_target = pq_getmsgstring(&input_message);
int describe_type;
const char *describe_target;
- forbidden_in_wal_sender(firstchar);
+ if (unlikely(am_walsender))
+ forbidden_in_wal_sender(firstchar);
/* Set statement_timestamp() (needed for xact) */
SetCurrentStatementStartTimestamp();
AssertArg(MemoryContextIsValid(context));
AssertNotInCriticalSection(context);
- if (!AllocSizeIsValid(size))
+ if (unlikely(!AllocSizeIsValid(size)))
elog(ERROR, "invalid memory alloc request size %zu", size);
context->isReset = false;
AssertArg(MemoryContextIsValid(context));
AssertNotInCriticalSection(context);
- if (!AllocSizeIsValid(size))
+ if (unlikely(!AllocSizeIsValid(size)))
elog(ERROR, "invalid memory alloc request size %zu", size);
context->isReset = false;
AssertArg(MemoryContextIsValid(context));
AssertNotInCriticalSection(context);
- if (!AllocSizeIsValid(size))
+ if (unlikely(!AllocSizeIsValid(size)))
elog(ERROR, "invalid memory alloc request size %zu", size);
context->isReset = false;
AssertArg(MemoryContextIsValid(CurrentMemoryContext));
AssertNotInCriticalSection(CurrentMemoryContext);
- if (!AllocSizeIsValid(size))
+ if (unlikely(!AllocSizeIsValid(size)))
elog(ERROR, "invalid memory alloc request size %zu", size);
CurrentMemoryContext->isReset = false;
AssertArg(MemoryContextIsValid(CurrentMemoryContext));
AssertNotInCriticalSection(CurrentMemoryContext);
- if (!AllocSizeIsValid(size))
+ if (unlikely(!AllocSizeIsValid(size)))
elog(ERROR, "invalid memory alloc request size %zu", size);
CurrentMemoryContext->isReset = false;
MemoryContext context;
void *ret;
- if (!AllocSizeIsValid(size))
+ if (unlikely(!AllocSizeIsValid(size)))
elog(ERROR, "invalid memory alloc request size %zu", size);
/*
AssertArg(MemoryContextIsValid(context));
AssertNotInCriticalSection(context);
- if (!AllocHugeSizeIsValid(size))
+ if (unlikely(!AllocHugeSizeIsValid(size)))
elog(ERROR, "invalid memory alloc request size %zu", size);
context->isReset = false;
MemoryContext context;
void *ret;
- if (!AllocHugeSizeIsValid(size))
+ if (unlikely(!AllocHugeSizeIsValid(size)))
elog(ERROR, "invalid memory alloc request size %zu", size);
/*