libbb/xrealloc_vector.c: better comment
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
12450dbeef
commit
1502a8b4ce
@ -20,8 +20,9 @@
|
|||||||
* idx step, plus one: if idx == 0x20, vector[] is resized to 0x31,
|
* idx step, plus one: if idx == 0x20, vector[] is resized to 0x31,
|
||||||
* thus last usable element is vector[0x30].
|
* thus last usable element is vector[0x30].
|
||||||
*
|
*
|
||||||
* In other words: after xrealloc_vector(v, 4, idx) it's ok to use
|
* In other words: after xrealloc_vector(v, 4, idx), with any idx,
|
||||||
* at least v[idx] and v[idx+1], for all idx values.
|
* it's ok to use at least v[idx] and v[idx+1].
|
||||||
|
* v[idx+2] etc generally are not ok.
|
||||||
*
|
*
|
||||||
* New elements are zeroed out, but only if realloc was done
|
* New elements are zeroed out, but only if realloc was done
|
||||||
* (not on every call). You can depend on v[idx] and v[idx+1] being
|
* (not on every call). You can depend on v[idx] and v[idx+1] being
|
||||||
|
Loading…
Reference in New Issue
Block a user