Use of 8192 as BLCKSZ in xlog.c

Started by Mark Kirkwoodabout 20 years ago5 messages
#1Mark Kirkwood
markir@paradise.net.nz

In two of the sections covered by #ifdef WAL_DEBUG there are
declarations like:

char buf[8192];

It seems to me that these should be:

char buf[BLCKSZ];

- or have I misunderstood what is going on here?

I realize that it's probably not terribly significant, as most people
will do development with BLCKSZ=8192 anyway - I'm just trying to
understand the code ... :-).

regards

Mark

#2Qingqing Zhou
zhouqq@cs.toronto.edu
In reply to: Mark Kirkwood (#1)
Re: Use of 8192 as BLCKSZ in xlog.c

"Mark Kirkwood" <markir@paradise.net.nz> wrote

In two of the sections covered by #ifdef WAL_DEBUG there are declarations
like:

char buf[8192];

It seems to me that these should be:

char buf[BLCKSZ];

Those two 8192 have nothing to do with BLCKSZ, it is just an arbitrary
buffer size as long as it is big enough to hold debug information.

Regards,
Qingqing

#3Michael Glaesemann
grzm@myrealbox.com
In reply to: Qingqing Zhou (#2)
Re: Use of 8192 as BLCKSZ in xlog.c

On Nov 22, 2005, at 11:44 , Qingqing Zhou wrote:

"Mark Kirkwood" <markir@paradise.net.nz> wrote

In two of the sections covered by #ifdef WAL_DEBUG there are
declarations
like:

char buf[8192];

Those two 8192 have nothing to do with BLCKSZ, it is just an arbitrary
buffer size as long as it is big enough to hold debug information.

Would it make sense to abstract that out so it's clear that it's
*not* related to BLCKSZ? Or maybe just a comment would be enough.

Michael Glaesemann
grzm myrealbox com

#4Qingqing Zhou
zhouqq@cs.toronto.edu
In reply to: Michael Glaesemann (#3)
Re: Use of 8192 as BLCKSZ in xlog.c

On Mon, 21 Nov 2005, Michael Glaesemann wrote:

Would it make sense to abstract that out so it's clear that it's
*not* related to BLCKSZ? Or maybe just a comment would be enough.

"Insprite of incremental improvement", I think rename "buf" to "str" would
work,

Regards,
Qingqing

#5Mark Kirkwood
markir@paradise.net.nz
In reply to: Qingqing Zhou (#2)
Re: Use of 8192 as BLCKSZ in xlog.c

Qingqing Zhou wrote:

"Mark Kirkwood" <markir@paradise.net.nz> wrote

In two of the sections covered by #ifdef WAL_DEBUG there are declarations
like:

char buf[8192];

Those two 8192 have nothing to do with BLCKSZ, it is just an arbitrary
buffer size as long as it is big enough to hold debug information.

Thanks - of course, different sort of buffer!

It is a bit more obvious now that I'm running with WAL_DEBUG enabled,
and can see that nature of the output. As has been suggested, maybe a
comment about the size and nature of 'buf' might be a nice addition.

cheers

Mark