From: Ben Pfaff Date: Tue, 21 Nov 2006 13:04:33 +0000 (+0000) Subject: Clarify condition on BUF_SIZE in monitor example. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=77d8be3371885c666edd5900573ff14f5755a65c;p=pintos-anon Clarify condition on BUF_SIZE in monitor example. Thanks to Terje Mathiesen for pointing out this issue. --- diff --git a/doc/reference.texi b/doc/reference.texi index 5e4db9e..3d7d9bc 100644 --- a/doc/reference.texi +++ b/doc/reference.texi @@ -844,6 +844,11 @@ char get (void) @{ @} @end example +Note that @code{BUF_SIZE} must divide evenly into @code{SIZE_MAX + 1} +for the above code to be completely correct. Otherwise, it will fail +the first time @code{head} wraps around to 0. In practice, +@code{BUF_SIZE} would ordinarily be a power of 2. + @node Optimization Barriers @subsection Optimization Barriers