diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2016-04-12 11:42:06 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2016-04-12 11:42:06 -0400 |
commit | 5713f03973e26ad6df6df5ac8b9efa0123d68062 (patch) | |
tree | c526803a22b48a7f42cd383ec69a88f9a67e5bed /contrib/bloom/blutils.c | |
parent | bdf7db81921deb99fd9d489cbcc635906c89e215 (diff) | |
download | postgresql-5713f03973e26ad6df6df5ac8b9efa0123d68062.tar.gz postgresql-5713f03973e26ad6df6df5ac8b9efa0123d68062.zip |
Improve API of GenericXLogRegister().
Rename this function to GenericXLogRegisterBuffer() to make it clearer
what it does, and leave room for other sorts of "register" actions in
future. Also, replace its "bool isNew" argument with an integer flags
argument, so as to allow adding more flags in future without an API
break.
Alexander Korotkov, adjusted slightly by me
Diffstat (limited to 'contrib/bloom/blutils.c')
-rw-r--r-- | contrib/bloom/blutils.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/contrib/bloom/blutils.c b/contrib/bloom/blutils.c index edfdfb934f6..5e506eaee40 100644 --- a/contrib/bloom/blutils.c +++ b/contrib/bloom/blutils.c @@ -39,7 +39,7 @@ PG_FUNCTION_INFO_V1(blhandler); /* Kind of relation optioms for bloom index */ static relopt_kind bl_relopt_kind; -static int32 myRand(); +static int32 myRand(void); static void mySrand(uint32 seed); /* @@ -173,15 +173,16 @@ initBloomState(BloomState *state, Relation index) static int32 next; static int32 -myRand() +myRand(void) { - /* + /*---------- * Compute x = (7^5 * x) mod (2^31 - 1) * without overflowing 31 bits: * (2^31 - 1) = 127773 * (7^5) + 2836 * From "Random number generators: good ones are hard to find", * Park and Miller, Communications of the ACM, vol. 31, no. 10, * October 1988, p. 1195. + *---------- */ int32 hi, lo, x; @@ -418,7 +419,7 @@ BloomInitMetapage(Relation index) /* Initialize contents of meta page */ state = GenericXLogStart(index); - metaPage = GenericXLogRegister(state, metaBuffer, true); + metaPage = GenericXLogRegisterBuffer(state, metaBuffer, GENERIC_XLOG_FULL_IMAGE); BloomInitPage(metaPage, BLOOM_META); metadata = BloomPageGetMeta(metaPage); |