Re: [HACKERS] [PATCH 02/16] Add zeroRecPtr as a shortcut for initializing a local variable to {0, 0}
On Thursday, June 14, 2012 03:50:28 PM Robert Haas wrote: On Wed, Jun 13, 2012 at 7:28 AM, Andres Freund and...@2ndquadrant.com wrote: This is locally defined in lots of places and would get introduced frequently in the next commits. It is expected that this can be defined in a header-only manner as soon as the XLogInsert scalability groundwork from Heikki gets in. This appears to be redundant with the existing InvalidXLogRecPtr, defined in access/transam.h. I dropped the patch from the series in the git repo and replaced every usage with the version in transam.h Greetings, Andres -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] [PATCH 02/16] Add zeroRecPtr as a shortcut for initializing a local variable to {0, 0}
On Wed, Jun 13, 2012 at 7:28 AM, Andres Freund and...@2ndquadrant.com wrote: This is locally defined in lots of places and would get introduced frequently in the next commits. It is expected that this can be defined in a header-only manner as soon as the XLogInsert scalability groundwork from Heikki gets in. This appears to be redundant with the existing InvalidXLogRecPtr, defined in access/transam.h. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] [PATCH 02/16] Add zeroRecPtr as a shortcut for initializing a local variable to {0, 0}
On Thursday, June 14, 2012 03:50:28 PM Robert Haas wrote: On Wed, Jun 13, 2012 at 7:28 AM, Andres Freund and...@2ndquadrant.com wrote: This is locally defined in lots of places and would get introduced frequently in the next commits. It is expected that this can be defined in a header-only manner as soon as the XLogInsert scalability groundwork from Heikki gets in. This appears to be redundant with the existing InvalidXLogRecPtr, defined in access/transam.h. Oh. I didn't find that one. Judging from all the code defining local variants of it I am not alone in that... Why is it in transam.h and not xlogdefs.h? Obviously that patch is void then. Doesn't warrant rebasing the other patches yet though... Thanks! Andres -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] [PATCH 02/16] Add zeroRecPtr as a shortcut for initializing a local variable to {0, 0}
On Thu, Jun 14, 2012 at 9:57 AM, Andres Freund and...@2ndquadrant.com wrote: On Thursday, June 14, 2012 03:50:28 PM Robert Haas wrote: On Wed, Jun 13, 2012 at 7:28 AM, Andres Freund and...@2ndquadrant.com wrote: This is locally defined in lots of places and would get introduced frequently in the next commits. It is expected that this can be defined in a header-only manner as soon as the XLogInsert scalability groundwork from Heikki gets in. This appears to be redundant with the existing InvalidXLogRecPtr, defined in access/transam.h. Oh. I didn't find that one. Judging from all the code defining local variants of it I am not alone in that... Why is it in transam.h and not xlogdefs.h? Uh, not sure. We used to have a variable by that name defined in a bunch of places, and I cleaned it up some in commit 503c7305a1e379f95649eef1a694d0c1dbdc674a. But if there are still more redundant definitions floating around, it would be nice to clean those up. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
Re: [HACKERS] [PATCH 02/16] Add zeroRecPtr as a shortcut for initializing a local variable to {0, 0}
On Thursday, June 14, 2012 04:04:22 PM Robert Haas wrote: On Thu, Jun 14, 2012 at 9:57 AM, Andres Freund and...@2ndquadrant.com wrote: On Thursday, June 14, 2012 03:50:28 PM Robert Haas wrote: On Wed, Jun 13, 2012 at 7:28 AM, Andres Freund and...@2ndquadrant.com wrote: This is locally defined in lots of places and would get introduced frequently in the next commits. It is expected that this can be defined in a header-only manner as soon as the XLogInsert scalability groundwork from Heikki gets in. This appears to be redundant with the existing InvalidXLogRecPtr, defined in access/transam.h. Oh. I didn't find that one. Judging from all the code defining local variants of it I am not alone in that... Why is it in transam.h and not xlogdefs.h? Uh, not sure. We used to have a variable by that name defined in a bunch of places, and I cleaned it up some in commit 503c7305a1e379f95649eef1a694d0c1dbdc674a. But if there are still more redundant definitions floating around, it would be nice to clean those up. Forget it, they are in things that don't link to the backend... /me looks forward to the 64bit conversion of XLogRecPtr's. Andres -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
[HACKERS] [PATCH 02/16] Add zeroRecPtr as a shortcut for initializing a local variable to {0, 0}
From: Andres Freund and...@anarazel.de This is locally defined in lots of places and would get introduced frequently in the next commits. It is expected that this can be defined in a header-only manner as soon as the XLogInsert scalability groundwork from Heikki gets in. --- src/backend/access/transam/xlogutils.c |1 + src/include/access/xlogdefs.h |1 + 2 files changed, 2 insertions(+) diff --git a/src/backend/access/transam/xlogutils.c b/src/backend/access/transam/xlogutils.c index 6ddcc59..3a2462b 100644 --- a/src/backend/access/transam/xlogutils.c +++ b/src/backend/access/transam/xlogutils.c @@ -51,6 +51,7 @@ typedef struct xl_invalid_page static HTAB *invalid_page_tab = NULL; +XLogRecPtr zeroRecPtr = {0, 0}; /* Report a reference to an invalid page */ static void diff --git a/src/include/access/xlogdefs.h b/src/include/access/xlogdefs.h index 5e6d7e6..2768427 100644 --- a/src/include/access/xlogdefs.h +++ b/src/include/access/xlogdefs.h @@ -35,6 +35,7 @@ typedef struct XLogRecPtr uint32 xrecoff;/* byte offset of location in log file */ } XLogRecPtr; +extern XLogRecPtr zeroRecPtr; #define XLogRecPtrIsInvalid(r) ((r).xrecoff == 0) -- 1.7.10.rc3.3.g19a6c.dirty -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers