version 1.4.2.1, 2006/03/17 18:59:03
|
version 1.4.2.2, 2006/05/12 18:28:20
|
|
|
| |
static Uint32 _next_pow_2(Uint32 x) | static Uint32 _next_pow_2(Uint32 x) |
{ | { |
|
// Check for potential overflow in x. |
|
PEGASUS_CHECK_CAPACITY_OVERFLOW(x); |
|
|
if (x < MIN_CAPACITY) | if (x < MIN_CAPACITY) |
return MIN_CAPACITY; | return MIN_CAPACITY; |
| |
|
|
_rep->size = 0; | _rep->size = 0; |
} | } |
else | else |
|
{ |
|
// Check for potential overflow. |
|
PEGASUS_CHECK_CAPACITY_OVERFLOW(_rep->cap); |
_rep = _reallocate(_rep, _rep->cap ? (2 * _rep->cap) : MIN_CAPACITY); | _rep = _reallocate(_rep, _rep->cap ? (2 * _rep->cap) : MIN_CAPACITY); |
} | } |
|
} |
| |
void Buffer::insert(size_t pos, const char* data, size_t size) | void Buffer::insert(size_t pos, const char* data, size_t size) |
{ | { |