copy.c allocation constant

From: Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: copy.c allocation constant
Date: 2017-11-28 16:51:28
Message-ID: be36afdf-8b01-fe4a-0328-2a6cd9540ad3@2ndQuadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

While reading copy.c I noticed this line:

#define RAW_BUF_SIZE 65536        /* we palloc RAW_BUF_SIZE+1 bytes */

Doesn't that seem rather odd? If we're adding 1 wouldn't it be better as
65535 so we palloc a power of 2?

I have no idea if this affects performance, but it did strike me as strange.

cheers

andrew

--
Andrew Dunstan https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2017-11-28 16:53:50 Re: documentation is now XML
Previous Message Peter Eisentraut 2017-11-28 16:34:24 Re: [HACKERS] SQL procedures