X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=doc%2Freference.texi;h=3d7d9bcbd2bbb2df58152293f4b09173cb60aff4;hb=61baa0fd8ef0289a446e80e69aa3f59e3f6c7013;hp=5e4db9e8fc482065383f73f5fe4bb7f7049b4571;hpb=3bfe19d40b6939483a7524cc269e32b52514cf12;p=pintos-anon 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