mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
don't grow the buffer quite so large
This commit is contained in:
parent
bb0b1424d8
commit
d505d4365c
@ -30,7 +30,7 @@ static const size_t extra_size = 50;
|
|||||||
void DCPackData::
|
void DCPackData::
|
||||||
set_used_length(size_t size) {
|
set_used_length(size_t size) {
|
||||||
if (size > _allocated_size) {
|
if (size > _allocated_size) {
|
||||||
_allocated_size = size * size + extra_size;
|
_allocated_size = size + size + extra_size;
|
||||||
char *new_buf = new char[_allocated_size];
|
char *new_buf = new char[_allocated_size];
|
||||||
if (_used_length > 0) {
|
if (_used_length > 0) {
|
||||||
memcpy(new_buf, _buffer, _used_length);
|
memcpy(new_buf, _buffer, _used_length);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user