[PATCH] PAGE_SIZE in libsbuf

Kostik Belousov kostikbel at gmail.com
Sun Jul 3 12:34:42 UTC 2011


On Sun, Jul 03, 2011 at 02:07:59PM +0200, Robert Millan wrote:
> 2011/7/3 Kostik Belousov <kostikbel at gmail.com>:
> > I think the different workaround is already included in the latest
> > sbuf source. Please see
> > http://svnweb.freebsd.org/base/head/sys/kern/subr_sbuf.c?revision=222015&view=markup
> 
> How does libsbuf react if the guess fails?  Also note this codepath
> isn't tested in FreeBSD (except for pc98).
> 
> I'm afraid this situation could lead to runtime errors somehow.  I'd
> still propose replacing this guess with a sysconf() check.

Which runtime errors ? The constant is used to size the malloc
allocations. Use of the PAGE_SIZE is an attempt to do some optimization.

I think it would work if you use e.g. 42 instead of PAGE_SIZE.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20110703/39348030/attachment.pgp


More information about the freebsd-hackers mailing list