src/cx/buffer.h

changeset 1291
5942859fd76c
parent 1290
4ac889e14211
equal deleted inserted replaced
1290:4ac889e14211 1291:5942859fd76c
472 /** 472 /**
473 * Ensures that the buffer has a minimum capacity. 473 * Ensures that the buffer has a minimum capacity.
474 * 474 *
475 * If the current capacity is not sufficient, the buffer will be extended. 475 * If the current capacity is not sufficient, the buffer will be extended.
476 * 476 *
477 * The new capacity will be a power of two until the system's page size is reached.
478 * Then, the new capacity will be a multiple of the page size.
479 *
477 * @param buffer the buffer 480 * @param buffer the buffer
478 * @param capacity the minimum required capacity for this buffer 481 * @param capacity the minimum required capacity for this buffer
479 * @retval zero the capacity was already sufficient or successfully increased 482 * @retval zero the capacity was already sufficient or successfully increased
480 * @retval non-zero on allocation failure 483 * @retval non-zero on allocation failure
481 * @see cxBufferShrink() 484 * @see cxBufferShrink()

mercurial