Description of problem: In Allocators.xml, line 135 to 138, you write: " .... For instance, to allocate an array of <literal>n</literal> elements of type <literal>T</literal>, check that the requested size is not greater than <literal>n / sizeof(T)</literal>." It is not rather? " .... For instance, to allocate an array of <literal>n</literal> elements of type <literal>T</literal>, check that the requested size is not smaller than <literal>n * sizeof(T)</literal>." Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
(In reply to Gé Baylard from comment #0) > Description of problem: > In Allocators.xml, line 135 to 138, you write: > " .... For instance, > to allocate an array of <literal>n</literal> elements of type > <literal>T</literal>, check that the requested size is not > greater than <literal>n / sizeof(T)</literal>." > > It is not rather? > " .... For instance, > to allocate an array of <literal>n</literal> elements of type > <literal>T</literal>, check that the requested size is not > smaller than <literal>n * sizeof(T)</literal>." Right, this is buggy, the expresion should be <literal>(~(size_t)0) / sizeof(T)</literal>. Thanks for spotting this.
Fixed in 876a1bcbd0b2687867aded985d142df5030988ae. Thanks again.
What's the status of this? Did this make it into the guide?
See comment #2. The Docbook sources have been updated, but we have not been able to publish an updated HTML version. Before we can do that, we need to update the revision log.
I'm closing this bug as part of a Bugzilla cleanup effort. The most likely reason is that the bug has been opened either against a component we no longer publish, or against Release Notes for an EOL release.